Giter Club home page Giter Club logo

i18nliner-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

i18nliner-js's Issues

switch to recast

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)

underscoredKeyLength is ignored

with the move of settings from I18nliner over to I18nliner.config, this one got overlooked, so inferred keys currently have no upper bound

inferred pluralization can cause key collisions

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)

load plugins first from .i18nrc

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

auto-pluralization doesn't work

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")

runtime plugin extensions

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:

  1. signal that they have runtime extensions (perhaps multiple exports? or i18nliner could require("plugin-name/runtime")?)
  2. do so in such a way so as not to include its non-runtime extensions in the browserified file ... i.e. it makes no sense to bloat the runtime bundle with extractors/etc

files with .jsx extensions is not being scanned to export

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.

whitespace should not be stripped from defaults

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

.i18nrc file, easy plugin registration mechanism

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.

Parameterized i18nliner export

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 :)

rethink globby usage (or make globby faster?)

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:

  1. be able to specify a directory/directories where your js files live and only look in there
  2. reimplement globby to do lazy enumeration. a big win there is we could break up exclusion patterns and not walk directories we know we don't need to

might be worth looking into the other globby to see if we can build on top of that instead

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.