Comments (2)
@aseemk thanks!
To make sure I understand, you can use translation_directory
to set the base path, but you want to avoid having a per-locale directory structure and just want en.json, es.json, etc.
I think we can make an optional configuration setting which is a function and returns the name of the translation file. The default implementation would match what we do today and if a user provides a function, it could do a flat directory like you want.
Maybe something like
options = {
"translation_file_path": function(dir, locale) {
return path.join(dir, locale + '.json');
},
...
}
How does that sound?
from i18n-abide.
Conceptually, that sounds good. This option seems to overlap with the directory
option though, if I'm returning an absolute path. Maybe just return a relative path, and only take the locale as an input?
from i18n-abide.
Related Issues (20)
- switch to minimist
- How to extract strings from handlebars templates? HOT 1
- res.locals is clobbered during initialization HOT 4
- Make the lock file configurable to avoid colliding locks
- Extract-pot throws error HOT 12
- Don't Work
- How can I change default_lang via API? HOT 5
- Extract-pot and gettext error
- Always lang in url HOT 2
- interpolate using [_1], [_2], etc...
- extract-pot for html only files HOT 2
- Versions in package.json
- npm v3 compatibility HOT 1
- error: unknown option `--from-code' HOT 2
- json_locale_data is not defined
- Doubt using i18n-abide client-side translations HOT 2
- Update npm contributor list HOT 3
- CODE_OF_CONDUCT.md file missing
- Error: ENOENT: no such file or directory, open '`find'
- Add open source software license
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18n-abide.