Comments (5)
That would be awesome @PupoSDC !
from firecms.
Closing this for lack of activity
from firecms.
Hi @fabarea that would be great!
We currently don't have any localization framework in place. Do you have any suggestions?
from firecms.
I have made good experience with i18next
and react-i18next
. In the main index.ts
you would find something like that:
// to be put quite "high" in the import list to have the i18 framework initialize early.
import './i18next-init'
In 18next-init.ts
:
import i18next from 'i18next'
import common_en from './translations/en/common.json'
import common_es from './translations/es/common.json'
i18next.init({
interpolation: { escapeValue: false }, // React already does escaping
lng: 'fr', // language to use
resources: {
en: {
translation: common_en
}
es: {
translation: common_es
},
...
}
})
Then, it whatever file you can have something like that:
import i18next from 'i18next'
console.log(i18next.t('hello'))
Example for the productionCollution.ts
...
import i18next from 'i18next'
const productCollection = buildCollection({
name: i18next.t('products'), // <------
relativePath: 'products',
schema: productSchema,
textSearchDelegate: productsSearchDelegate,
additionalColumns: [productAdditionalColumn],
subcollections: [localeCollection],
defaultSize: 'xs'
})
from firecms.
Hi @fgatti675, If this is low priority for you, I would like to give this a try. react-18next
is also my favourite framework for this, so i would use that. I can Provide translation to Portuguese, and eventually, my company would appreciate having in german ;)
from firecms.
Related Issues (20)
- [regression bug] Default optional image URL is stored as empty string instead of `null` HOT 2
- Any documentation on how to write a custom plugin? HOT 2
- Missing dependency in useCallback breaks text search HOT 3
- build nextjs app lags HOT 4
- Is there a way to disable the option to create users when there is none with the provided email? HOT 3
- Fails under Initialize dependencies w Network error HOT 1
- Permissions
- Not able to provide sign in through email and password. Help please
- Multiple Read Write when text field updated
- CMS Freezes randomly in Microsoft Edge - Chrome seems fine. HOT 2
- Can't Reproduice the key/value feature HOT 1
- How can I use firebase emulators with FireCMS? HOT 1
- How do I get current user id in a property? HOT 2
- Attempted import error: 'getCountFromServer' is not exported from 'firebase/firestore' (imported as 'sl'). HOT 2
- Run the test on firecms project failed
- 2.0.1 breaks CustomEntityViews (shows blank) HOT 15
- Page not found - but page is here HOT 2
- How can I use current user id in conditional field?
- Text search + inline table modification bug
- pt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firecms.