This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Translation of class names based on "language" property on metadata card

Hi

Is it possible to translate document class names based on a 'Language'-property on the metadata card?

Example:
Our class names are all written in German (i.e. Pr?sentation)  --  which stands for presentation in German
We want the class name to be translated whenever the value list item 'English' is selected in the metadata card

I tried this using Metadata Card Configuration, but it did not work (maybe the object name is a simple concatenation of properties?).

Thanks for your feedback.

Cheers
Peter
  • I must admit that this isn't something that I've done before, but I believe that you can translate value list items (class name is a value list item)using the built-in functionality (www.m-files.com/.../translating_the_metadata_structure.html). If you do this then the M-Files desktop client will choose the correct term to show based on the user's language.

    It may behave differently for class, I'm not sure, but that's where I would start.

    Regards,

    Craig.
  • Hi Craig

    Ok, thanks. I will look into the built-in functionality.

    On the other hand - why is the metadata card configuration not working (see attached).
    Because the name/title property is a simple concatenation of properties and overrules the metadata card configuration?

    Cheers
    Peter
    41934.zip
  • The built-in functionality won't work either...

    The class names are shown in the translated language in the metadata card (Class: Presentation)

    But in the object title (which is a simple concatenated property ([Class] - [Name of document]), M-Files still pulls the original class name from the vault configuration (Pr?sentation - [Name of document]).
  • I can confirm that you can translate Class names and other user built structure elements. When you create new value lists, you can configure whether the content should be available for translation or not. It is simple but somewhat tedious process to translate everything in Excel after having exported the table. The good thing is that you can mark translations with versions and mark items to point out those that have been translated. That way you can reduce the exported file when updating next time, and you can sort the content.
    From memory the translation options in Metadata Card Configuration are related to tool tips, headlines and other interface related items that you may configure in that part of the system - not to the basic structure nor the content.
    However, the built in translation requires the user to select language for the vault. It will not respond to some metadata. Note that you can change language for the desktop interface and for the vault structure separately. You may have a German user interface and English structure elements if you like.

  • The built-in functionality won't work either...

    The class names are shown in the translated language in the metadata card (Class: Presentation)

    But in the object title (which is a simple concatenated property ([Class] - [Name of document]), M-Files still pulls the original class name from the vault configuration (Pr?sentation - [Name of document]).


    Hi Peter,

    I misunderstood your question - I didn't realise that you were using this as part of a concatenated property for the name. I thought that this question was just about the visual display of the class name.

    I think, in this case, I would probably use code to calculate the document title rather than using the metadata card configuration. I personally would do this because metadata card configuration rules do not necessarily fire in all situations (e.g. if an object is created via the API).

    Regards,

    Craig.
  • Maybe I wasn't very clear about what my intention is :)

    Ok, using code is another possibility. the issue here is, that we're using the (concat) name property for many document classes (always [Class] - [Name of document]).

    Do you know by memory if the translation values are accesible via code?

    Also, I think this could be a possible improvement request - I would assume when switching to another language, also the document title including the translated class values change...
  • Hi Peter,

    I believe that the translations are available via code (www.m-files.com/.../index.html, but I don't know what format that JSON is in and how easy it will be to use.

    For translatable object titles, we already have a feature in newer M-Files versions: www.m-files.com/.../enabling_translatable_object_titles.html
    I've not used this before, but it sounds like it may be interesting to you.

    Regards,

    Craig.
  • Hi Craig

    Thanks for the hint regarding the API. Will look into this.

    I already looked into the functionality "Translatable Object Titles", but it won't help because the translation is meant for [Name of document] or other text fields (text field is mandatory) in different languages and not value lists like [Class].

    Cheers
    Peter
  • Hi Peter,

    Sorry, now it is me being unclear :)

    What I meant was that you could have a number of "Document title" properties (German, English, French, etc.), all populated via server-side script (each using the correct translation from the above JSON). You could then use this functionality to make the correct one appear for each user, depending on their UI language.

    I thought this approach may be more suitable than directly using the JSON and creating the document title based on the language selected on the dropdown, as that way you have titles in all languages rather than just the single translated version that the submitting user selected.

    Regards,

    Craig.