Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I support 'dynamic' things? #75

Open
mackbrowne opened this issue Feb 8, 2018 · 3 comments
Open

How do I support 'dynamic' things? #75

mackbrowne opened this issue Feb 8, 2018 · 3 comments

Comments

@mackbrowne
Copy link

I'd like to put a list that needs to be translated in my reducer instead of in my component. This works fine, however when it comes time to extract these values out of the code, it won't happen because the 't' function is working with an iterator instead of a hardcoded string.

I've seen workarounds in here on how to get the context out of the component and into other parts of the app, is the reccomended way to translate things that exist outside of the component?

@shankie-codes
Copy link

By "dynamic", do you mean things that come, say, from a database?

If that's what you mean, I've made a (very incomplete) start at a package to do this... https://www.npmjs.com/package/redux-i18n-parse-content-tags

@mackbrowne
Copy link
Author

most of the things coming from a database will be pre-translated. I'm more talking about arrays or objects that I may be creating internally. For example, I could hardcode 5 list items in a component, or I could map over them. Another good example would be how to apply translations to components from plugins.

@shankie-san great plugin, I could definitely see a use for this. More than anything though I need a way to wrap 't' function wiht something else besides hardcoded strings.

@shankie-codes
Copy link

Ah ok cool @mackbrowne that makes sense.

Out of curiousit, what are you using to translate the strings out of the database?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants