Forum Stats

  • 3,817,096 Users
  • 2,259,276 Discussions
  • 7,893,655 Comments

Discussions

merge option in the ojL10n definition for a webcomponent??

3996985
3996985 Member Posts: 9
edited Jul 5, 2019 8:17AM in Oracle JET

Hi,

I have a issue regarding the translation.

I created a component (test-component) and the structure is like that:

pastedImage_0.png

on my nls/fr/testTranslation.js I got this :

pastedImage_1.png

on the nls/testTranslations.js :

pastedImage_2.png

In my view Model on defined I got this :

pastedImage_3.png

Who do I merge my file on my nls/ojstranslation (main application) and my nls files form my component?

Thanks,

Tagged:

Answers

  • Duncan Mills-Oracle
    Duncan Mills-Oracle Member Posts: 4,077 Employee
    edited Jul 5, 2019 8:17AM

    A component should not be trying to merge overrides for the core JET message bundles - just think what could happen if you have multiple components used in an app all fighting to override a particular resource.

    Each component should define it's own translation namespace - we standardise on the camelCase name of the component as the default for this. If a component then needs to override some translation used by a Core JET component *within* it's own view then you can manage that translation in the component resource bundle and then use the translations property on the JET component to inject the required override for that instance of the JET component in question