loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Translatable models

Open framp opened this issue 11 years ago • 4 comments

Is there any plan to provide a facility to translate string contained in other models?

The workflow could be:

Developer

  • Developer adds some options (in the same way the ACL works) to define which fields can be translated on a certain Model

User

  • User creates a model with defaultLanguage strings
  • User creates a Translation model which contains:
    • modelId: id of the translated model
    • modelName: name of the translated model
    • language: language of the translation
    • translation: object containing all the translated properties
    • The unique key will be on modelId+modelName+language

Requesting Data

When a request is returning a model and a language is specified in the request:

  • Query Translation with the given modelName, modelId and language
  • Merge translation object into the returning model

We've already set up this system in our company proprietary framework and it's working quite nicely. I think it could be an interesting addition to your framework and I'd love to hear your thoughts about this.

framp avatar Feb 16 '15 15:02 framp

Take a look at https://github.com/strongloop/strong-globalize

ritch avatar Dec 06 '16 18:12 ritch

@framp I have a similar requirement that of Translatable models which you posted in your comment. Did the strong-globalize module help you achieve that? Please share some thoughts on how you approached setup the translation system. Thanks in advance.

vijay22sai avatar Oct 25 '17 10:10 vijay22sai

@vijay22sai: Didn't get a chance to try it, I went for a custom made solution.

framp avatar Oct 25 '17 12:10 framp

@framp Ok, Thanks for the quick response. Please share if you used any other opensource stuff for this.

vijay22sai avatar Oct 25 '17 12:10 vijay22sai