fusionjs / fusion-plugin-i18n Goto Github PK
View Code? Open in Web Editor NEWMigrated to https://github.com/fusionjs/fusionjs
License: MIT License
Migrated to https://github.com/fusionjs/fusionjs
License: MIT License
I believe this occurs for 0.80 and greater. I'm using 0.82.
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/fusion-plugin-i18n/src/types.js:22:12
Cannot use function type as a type because function type is a value. To get the type of a value use typeof.
19│ export type I18nDepsType = {
20│ fetch?: typeof FetchToken.optional,
21│ hydrationState?: typeof HydrationStateToken.optional,
22│ loader?: I18nLoaderToken.optional,
23│ };
24│
25│ export type I18nServiceType = {
Currently there's no mechanism for client-side locale switching, which means a page refresh is required to change locales.
Perhaps there should be an API for doing this client-side.
Bug
Loader is trying to load en_au.json but the file is en-au.json
Translations aren't loaded
Translations should be loaded
fusion-plugin-i18n version: 1.0.2
Node.js version (node --version
): 8.9.4
npm version (npm --version
): 5.6.0
Operating System: OS X
Export the string interpolation function for applications to use the same logic when interpolating strings externally.
We recently updated the interpolation logic to be able to pass interpolation variables through in order to interpolate externally. This is useful for interpolating dynamic values into translation strings. Because this use case happens mixed with internally interpolated translation strings, being able to use the exact same logic in both places would help guarantee consistency of outcomes.
Related, if the plugin architecture or performance considerations allow, it would be easier to maintain the code and internal consistency if we extract the translation function from browser and node implementation into its own file and re-use that.
Would like to hear any concerns, specially on the architectural or performance constraints to extract the translation function. Based on those, I am happy to contribute the update.
Feature Request
We should probably have the i18n plugin add the lang attribute to the opening html tag, as it is recommended for accessibility. We can do this using ctx.template.htmlAttrs
Documentation regarding Fusion API is out of date given recent changes to leverage new Dependency Injection architecture.
Update documentation
Currently, a call to translate() will attempt to interpolate variables even if no interpolation values are provided returning a string interpolated with "undefined".
This result is unexpected and it would be preferable to return a string with the variables in it. Such string is useful when you want to interpolate the values somewhere else in the application.
For example:
translations: {interpolated: 'hi ${adjective} ${noun}'},
translate('interpolated', {adjective: 'big', noun: 'world'})
// 'hi big world'
translate('interpolated', {noun: 'world'})
// 'hi ${adjective} world'
translate('interpolated')
// 'hi ${adjective} ${noun}'
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Preset name not found within published preset config (monorepo:angularmaterial). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.