jenseng / i18nliner-js Goto Github PK
View Code? Open in Web Editor NEWI18n made simple
License: MIT License
I18n made simple
License: MIT License
speakingurl is listed under an older version and includes built files that do not cooperate as well with legacy browsers.
if there are check/export errors, we aren't properly reporting the status to grunt... you always get "Done, without errors"
rather than explicitly relying on esprima-fb, we should use recast instead like react-i18nliner does. additionally, we should use config.recastOptions (if provided). that way we'll consistently parse stuff, and it also makes it possible to swap out esprima-fb for both and instead use something like acorn (or even acorn-babel)
needs newlines to make it look prettier. compare:
http://cl.ly/image/3K0q0C3f3N3t/Screen%20Shot%202014-10-08%20at%209.27.48%20AM.png
vs
http://cl.ly/image/1A1O1g0r0d2f/Screen%20Shot%202014-10-08%20at%209.28.07%20AM.png
also should probably say <unsupported expression>
instead of <unsupport expression>
with the move of settings from I18nliner
over to I18nliner.config
, this one got overlooked, so inferred keys currently have no upper bound
Trying to use it with svelte. Got error on
Unexpected character '#' (2:1)
"#" is part of template language
if you have something like:
I18n.t("Session")
and elsewhere you have:
I18n.t("Session", {count: theCount})
// equivalent to
// I18n.t({one: "1 Session", other: "%{count} Sessions"}, {count: theCount})
you get a key as scope
error, because the second one infers the same key as the first one (session_3ac1c536
). for it to be truly equivalent to the longhand one:
/other:
object, it should infer the key from the other
value (e.g. count_sessions_f79b13d7
)
since plugins might define new i18nliner settings, we should initialize all plugins specified in .i18nrc
before any other settings in that file ... otherwise the plugin might overwrite those user overrides
like we do in i18nliner.rb ... sometimes you need to break up a string for readability, e.g.
I18n.t("lorem ipsum dolor sit amet bacon narwhals zomg this " +
"is getting out of control")
there are tests around this, but it could be something isn't wired up correctly...
I18n.t("foo", {count: count})
should be automagically equivalent to
I18n.t({one: "1 foo", other: "%{count} foos"}, {count: count})
but it's behaving like:
I18n.t("foo")
some plugins (e.g. react-i18nliner) may need to add some stuff to the i18n runtime extensions (e.g. stick ComponentInterpolator on the I18n global). so plugins need a way to:
require("plugin-name/runtime")
?)Hi,
I'm trying to export the labels, using:
./node_modules/.bin/i18nliner export
there is a way to configure which file type you want to scan file to extract the translatable labels?
I guess I need to add it in .i18nrc file, but I didn't found any example of it.
Regards.
underscored (and _crc32) keys get truncated so that they don't get too long, but due to an off-by-one oversight, the i18nliner(rb) ones are one char longer. we should make this value configurable both here and there, and make sure they default to the same thing (50 chars, not 51)
need to require it and add it in commands.js
sometimes trailing whitespace is relevant (e.g. when porting something like rails' Array#to_sentence
), so we should preserve it by default
that said, we should have a mechanism to override it ... e.g. for i18nliner-handlebars, whitespace stripping is probably desirable
kinda like how eslint does w/ .eslintrc ... basically we should have a config file where you indicate what add-ons you want (i18nliner-handlebars, react-i18nliner, etc), and i18nliner will just figure it out. this would also be a good place for any sort of settings (inferred key format, directories, etc)
that way you won't need to write any glue code ... as can be seen here, it can get a little out of control, and it you really can't just use the i18nliner bin or grunt task as-is.
i18nliner (or rather gglobby) follows symlinks. if a symlink is broken, everything asplodes. it should not.
this might need to be fixed in gglobby rather than i18nliner
CallHelpers.keyifyUnderscored doesn't convert dashes to underscores. this makes it slightly incompatible with i18nliner(.rb)
should audit it for any other obvious discrepancies
Hello, is there a way to tell i18nliner export to only search specific folders and specify an output file?
i.e. i18nliner --search /path/to/folder --output /path/to/json
Thanks :)
running the check command is quite slow, depending on the number of files in your directory... even though we auto-ignore node_modules, we still recursively walk everything (and non-js stuff too!) before selecting/excluding stuff
some ideas:
might be worth looking into the other globby to see if we can build on top of that instead
Is it webpack/rollup compatible?
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.