angular-translate / grunt-po2json-angular-translate Goto Github PK
View Code? Open in Web Editor NEWgrunt plugin to convert po to an angular-translate format
License: MIT License
grunt plugin to convert po to an angular-translate format
License: MIT License
Move to main project angular-translate/angular-translate#507
We have project structure
project
|- module1
|- locals
|- en.po
|- fr.po
|- module2
|- locals
|- en.po
|- fr.po
start
'compiled/locals' : ['project/**/*.po']
have result
compiled
|- locals
|- en.json
|- fr.json
But en/ru.json have string only from module2
Hey @DanielaValero this grunt plugin looks interesting! @firehist also implemented a grunt plugin for angular-translate. We're planning to move to an organization on github (http://github.com/angular-translate) there we also have a grunt-team which currently consists of @firehist only.
Maybe you're interested in joining the team as well? We would then put your grunt plugin under the organization umbrella :)
It make empty json objects. Maybe problem with path?
Prosess
project
|- module1
|- locals
|- en.po
|- fr.po
|- module2
|- locals
|- en.po
|- fr.po
Create
compiled
|- module1
|- locals
|- en.json
|- fr.json
|- module2
|- locals
|- en.json
|- fr.json
Api example
'compiled/*/locals' : ['project/*/locals/*.po']
Separate json create for each module automatically. It will be useful for big modular project.
Correct
.po:
msgstr[0] "Время: %d {name} секунда"
msgstr[1] "Время: %d {name} секунд"
msgstr[2] "Время: %d {name} секуды"
.json:
"Время: {{name}} {PLURALIZE, plural, offset:1 =2{# секунда} other{# секунд}}"
Incorrect
.po:
msgstr[0] "Время: %d секунда {name}"
msgstr[1] "Время: %d секунд {name}"
msgstr[2] "Время: %d секуды {name}"
.json:
"Время: {{PLURALIZE, plural, offset:1 =2{# секунда}} other{# секунд}} {name}"
Must be
"Время: {{PLURALIZE, plural, offset:1 =2{# секунда}} other{# секунд}} {{name}}"
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.