Help ! - Contact titles in several languages

Hi,

I have started to use suiteCRM for a migration, and I would like to manage contacts titles (functions) in several languages (EN / FR).

To achieve this, I have created a new module called “contact_title” :

  • ID (uuid)
  • code_title (old id CRM)
  • name
  • language

Exemple of data :

[table]
[tr]
[td]ID[/td]
[td]code_title[/td]
[td]name[/td]
[td]language[/td]
[/tr]
[tr]
[td]929a5b58-feab-483a-a39a-a3b583680eec[/td]
[td]S123[/td]
[td]Developper[/td]
[td]en[/td]
[/tr]
[tr]
[td]a835016a-a7e5-4f6a-8463-001bae752fd9[/td]
[td]S123[/td]
[td]Developpeur[/td]
[td]fr[/td]
[/tr]
[/table]

‘code_title’ is a same for the 2 languages.

But I have an issue with this solution.
In ‘Contact’, I need to use ‘code_title’ information and not ‘ID’, because I need to show ‘Developpeur’ if my PDF is displayed in French, or ‘Developper’ if it is displayed in english.
The title to be displayed must not depend on the Contact language but on the PDF display language.

Can I link Contact to Contact_title with ‘code_title’ information instead of UUID ? Or do I need to change the table structure or even my approach ?

Here would be my other solution for the table structure, but I don’t know if this is a better solution :

  • ID (uuid)
  • code_title (id old CRM)
  • name_fr
  • name_en

Thank you for your help !

In English, “developer” has only one “p” :slight_smile:

Anyway, there is a part of your scheme that you won’t be able to do without some (simple) PHP custom coding: the part where your PDF template chooses between the languages. That sort of conditional field substitution is not possible out-of-the-box…

Hi thank you for your response and the correction.

I will make a lot of PHP custom code, but in first time, I create modules and use studio for the simple things.
But I need your help to choose the best solution in my last post.

If you read this section of the Developer Guide you will find several ways to get the data from your tables:

https://docs.suitecrm.com/developer/working-with-beans/

You can search by any field, not just ID.

Instead of using a custom module for this, you could also leverage the existing language infra-structure of SuiteCRM:

https://docs.suitecrm.com/developer/language-strings/

Since you always need some custom PHP to fetch the correct language at the critical moment, it might be easier for you to just use the normal language strings. But it’s really up to you to decide which you prefer.

1 Like

Thank you for your reply.

I will look that !