laget-se / narp Goto Github PK
View Code? Open in Web Editor NEWA workflow utility to ease localization in JS(X) apps
License: Apache License 2.0
A workflow utility to ease localization in JS(X) apps
License: Apache License 2.0
Hi! I'm curious about the code below
/**
* Fetches all translations available and parses them into one big
* object with locales as keys and gettext-parser PO JSON as values.
*/
export const fetchTranslations = (options, credentials = {}) => {
const { project } = options;
feedback.step('Fetching available languages from POEditor...');
return fetchLanguages({ project }, credentials)
.then(languages => {
feedback.step(`Fetching translations for languages: ${languages} ...`);
return languages;
})
.then(languages => Promise.all(
languages.map(language =>
fetchTranslationsForLang({ project, language }, credentials)
)
))
.then(translations => translations.reduce((aggr, poJson) => ({
...aggr,
[poJson.headers.language]: poJson,
}), {}))
.catch(err => feedback.kill(err));
};
I found that the translations from different locales are merged into a json file. it will generate a huge file if i have many languages. It also makes coding splitting difficult.
So, could you tell me Why you do this?
Line 79 in 4b66792
Should call push
When calling narp push
narp runs the pull
-command.
When calling narp push -p=***
narp runs the expected command.
Is it possible we add a vendor that essentially waits for manual translation of the strings?
I want to use this tool in a fairly small app, using a translation service doesn't make sense for me.
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.