Skip to content
Permalink
Browse files

Updated the i18n csv and tot he new syntax

  • Loading branch information...
LaurentGoderre committed Mar 3, 2014
1 parent 0368aaa commit 6742e12b5405b29b55e4791122c2404c3577f677
Showing with 18 additions and 21 deletions.
  1. +0 −1 src/i18n/i18n.csv
  2. +18 −20 tasks/i18n.js
@@ -1,4 +1,3 @@
,String code,English,French,Afrikaans,Albanian,Arabic,Armenian,Bulgarian,Chinese,Chinese (Simplified),Czech,Dutch,Estonian,German,Greek,Hindi,Hungarian,Icelandic,Indonesian,Italian,Japanese,Korean,Latvian,Lithuanian,Polish,Portuguese,Portuguese (Brazilian),Russian,Slovak,Spanish,Thai,Turkish,Ukrainian,Vietnamese
Language code (ISO 639-1),lang-code,en,fr,af,sq,ar,hy,bg,zh,zh-Hans,cs,nl,et,de,el,hi,hu,is,id,it,ja,ko,lv,lt,pl,pt,pt-BR,ru,sk,es,th,tr,uk,vi
Language code (ISO 639-2/T),lang-code-iso-639-2,eng,fra,afr,sqi,ara,hye,bul,zho,zho-Hans,cze,nld,est,deu,ell,hin,hun,isl,ind,ita,jpn,kor,lav,lit,pol,por,por-BR,rus,slk,spa,tha,tur,ukr,vie
Language direction,lang-dir,ltr,ltr,ltr,ltr,rtl,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr,ltr
@@ -39,29 +39,27 @@ module.exports = function(grunt) {
"record",
function(row, index) {
//Skip the header row
if (index > 0) {
var i,
len = row.length;
// Copy and load the files on the line with the ISO 639-1 code
if (index === 1) {
grunt.log.write("Creating i18n dictionary files\n");
for (i = 2; i < len; i += 1) {
var filename = options.dest + row[i] + ".js";
wetLanguages[i - 2] = row[i];
langFiles[i] = basei18n;
outputNames[i] = filename;
}
}
//Replace the language strings with a fallback to the English if the token is missing
var i,
len = row.length;
// Copy and load the files on the line with the ISO 639-1 code
if (index === 0) {
grunt.log.write("Creating i18n dictionary files\n");
for (i = 2; i < len; i += 1) {
var match = new RegExp("@" + row[1] + "@", "g");
var replacement = row[i] === "" ? row[2] : row[i];
//TODO: Normalize quoting once translations can be changed in terms of escape character
replacement = replacement.replace(/"/g, "\\\"");
replacement = replacement.replace(/\\'/g, "'");
langFiles[i] = langFiles[i].replace(match, replacement);
var filename = options.dest + row[i] + ".js";
wetLanguages[i - 2] = row[i];
langFiles[i] = basei18n;
outputNames[i] = filename;
}
}
//Replace the language strings with a fallback to the English if the token is missing
for (i = 2; i < len; i += 1) {
var match = new RegExp("@" + row[1] + "@", "g");
var replacement = row[i] === "" ? row[2] : row[i];
//TODO: Normalize quoting once translations can be changed in terms of escape character
replacement = replacement.replace(/"/g, "\\\"");
replacement = replacement.replace(/\\'/g, "'");
langFiles[i] = langFiles[i].replace(match, replacement);
}
}
).on(
"end",

0 comments on commit 6742e12

Please sign in to comment.
You can’t perform that action at this time.