I'm working on a simple app with a few models which need to have multilingual attributes. E.g., a model "Article" with a "title" string attribute should have translation for English and French. I'm aware that Sails.js ships with I18n node module, but that seems to handle hardcoded string translations only. Does anyone have any experience with this or sample code to point me to? I'm looking for a best practice here, if possible.
相关问题
- Renaming named destinations in PDF files
- Making Django queries with localized dates
- Inserting a translation into a placeholder with Em
- Sails.js - PATH variable - sails command not recog
- Symfony Basic Translation Example
相关文章
- xslt localization
- Magento, translate validation error messages
- “Intl not available” in Edge 15
- Webworker-threads: is it OK to use “require” insid
- How to connect two docker containers through local
- How to convert float or currency to a localized st
- Write # in yaml (in the string)
- SELECT and UPDATE multiple records in oriento / or
You can do it 2 ways:
1.) Duplicate the fields in you model for each language like:
2.) You can add a "language"-attribute to your Articles (so you can select find().where({lang: 'en'}):
What way to choose depends on your usecase.