Closed barryytm closed 7 years ago
Is just adding a new column for setting the value 1
if it was reviewed and 0
otherwise good enough?
Where are you adding the column? What is the impact to the code that parses the csv file?
Also, be aware we can have more than two languages. E.g. this one has 3 https://github.com/fgpv-vpgf/fgpv-vpgf/blob/spanish/src/locales/translations.csv
Yeah, each language should have a "dirty" column, and these should be ignored when converting to JSON. We used a gulp-csv-i18n plugin for conversion, but it's different with the webpack now.
Please review the webpack plugin I wrote for the CSV to inline JSON conversion. https://github.com/fgpv-vpgf/fgpv-vpgf/blob/develop/scripts/translations_plugin.js#L28
Make sure the plugin is updated to the new format standard. Feel free to ask me questions if you get stuck.
Ok, I guess I will just put the dirty bit to the right of the translation then ignore it when converting to JSON in the plugin.
So something like...
Description of pigdog,app.pigdog,Pig Dog,1,Cochon chien,1,perro cerdo,0
Description of meatball,app.meatball,Meat Ball,1,Boule de viande,0,Bola de carne,0
and then modify the plugin to skip columns that follow a language (i.e read first two, then read one, skip one, read one, skip one, ....)
I was always curious why we went the CSV route for translations. Maybe its worth looking into a standard format for our translations?
I came across one called XLIFF 2.0
which is XML based. Among other things, it includes state (initial, translated, reviewed, final). There are npm libraries that convert it to JSON.
http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html
We did. In RAMP1 we used .po
files which were then converted to .json
as usual for consumption. However, our translation services don't know anything but Excel, so .po
files had to be converted to .cvs
before sending out for translation, converted back and re-integrated with existing translations. Not terribly difficult, but annoying and time-consuming. Also, WET uses the .csv
approach to manage their translations, and they have many more languages and was considered a best practice at the moment.
Add a dirty bit to the language translation file to indicate whether the French translation had been officially reviewed or not.