Code Monkey home page Code Monkey logo

Comments (4)

arajput avatar arajput commented on June 2, 2024 1

React package react-i18next is used for language support
ref- https://react.i18next.com/latest/using-with-hooks
--- proposal ---
Loading translation files
manifest file contains translations file paths for each supported language
"languages": [ { "title": "English", "path": "./language.en-gb.json", "overridePath": "./language-override.en-gb.json", "code": "en" }, { "title": "Hindi", "path": "./language.hi-in.json", "overridePath": "./language-override.hi-in.json", "code": "hi" } ],

  • App bootstrap code loads manifest of owned module and loads resources specified in above language section of manifest file.
  • App bootstrap also loaded modules files (which is list of remote modules used by the module or host app module). this module file provides base url for the remote module. use base url to load manifest file for remote module. read the language resources for each remote module and add to the language resources
  • init the i18n module with resources collected above.

** Resolving conflicting keys **
We need some convention of prefix for each module for keys.
How to avoid repeating keys in every usage of keys

Detecting language
Implement LanguageDetector from 'i18next-browser-languagedetector'

Using translation in component
use hook/HOC for using translate function of i18n

from frontend-modulefederation.

sagarkoshti1990 avatar sagarkoshti1990 commented on June 2, 2024

@arajput for temporary base this is solved

from frontend-modulefederation.

arajput avatar arajput commented on June 2, 2024

We need to find solution for below problems.
module has its own translation file. how do we share that file with other module which is dependent on the module?

Reference
https://github.com/shiksha-platform/shiksha-platform.github.io/blob/main/docs/Developer/Frontend/06-i18n.md

from frontend-modulefederation.

arajput avatar arajput commented on June 2, 2024

@ChakshuGautam / @Shruti3004 @sagarkoshti1990 -
i am able to solve the i18n translation file sharing from module using ChangedBackend plugin.
Refer commit -arajput@8fb81a2

from frontend-modulefederation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.