Skip to content
Merged
36 changes: 36 additions & 0 deletions bin/build-locales
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env node
/* eslint-disable no-var, no-console */
// We can't use strict mode because po2json causes
// referenceErrors.


const fs = require('fs');
const path = require('path');
const config = require('config');
const po2json = require('po2json');
const glob = require('glob');
const shelljs = require('shelljs');
const chalk = require('chalk');

const appName = config.get('appName');

if (!appName) {
console.log(
chalk.red('Please specify the appName with NODE_APP_INSTANCE'));
process.exit(1);
}

const localeDir = path.join(__dirname, '../locale');
const poFiles = glob.sync(`${localeDir}/**/${appName}.po`);
const dest = path.join(__dirname, '../src/locale/');

poFiles.forEach((pofile) => {
const dir = path.dirname(pofile);
const subdir = path.dirname(dir);
const locale = path.basename(subdir);
const stem = path.basename(pofile, '.po');
const jsonfile = path.join(dest, locale, `${stem}.json`);
shelljs.mkdir('-p', path.join(dest, locale));
const json = po2json.parseFileSync(pofile, { stringify: true, pretty: true, format: 'jed1.x' });
fs.writeFileSync(jsonfile, json);
});
10 changes: 7 additions & 3 deletions bin/create-locales
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ const glob = require('glob');
const path = require('path');
const shell = require('shelljs');

const supportedLocales = config.get('supportedLocales');
const supportedLangs = config.get('langs');
const localeDir = path.join(__dirname, '../locale');
const templateDir = path.join(localeDir, 'templates/LC_MESSAGES');
const potFiles = glob.sync(`${templateDir}/*.pot`);

require('babel-register');
const langToLocale = require('../src/core/i18n/utils').langToLocale;

let lang;
let locale;
let potFile;
let fileName;
let outputFile;

for (locale of supportedLocales) {
locale = locale.replace('-', '_');
for (lang of supportedLangs) {
locale = langToLocale(lang);
shell.exec(`mkdir -p ${localeDir}/${locale}/LC_MESSAGES/`);
for (potFile of potFiles) {
fileName = path.basename(potFile, '.pot');
Expand Down
3 changes: 1 addition & 2 deletions bin/debug-locales
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const glob = require('glob');
const path = require('path');
const shell = require('shelljs');

const debugLocales = ['dbg', 'dbg-rtl'];
const debugLocales = ['dbl', 'dbr'];
const localeDir = path.join(__dirname, '../locale');
const templateDir = path.join(localeDir, 'templates/LC_MESSAGES');
const potFiles = glob.sync(`${templateDir}/*.pot`);
Expand All @@ -30,7 +30,6 @@ let fileName;

for (locale of debugLocales) {
for (potFile of potFiles) {
locale = locale.replace('-', '_');
fileName = path.basename(potFile, '.pot');
poFile = path.join(localeDir, locale, 'LC_MESSAGES', `${fileName}.po`);
rewrite = locale === 'dbg' ? 'unicode' : 'flipped';
Expand Down
23 changes: 21 additions & 2 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ module.exports = {
client: false,
server: true,

// Disables the server side render, handy for debugging.
disableSSR: false,

// 2592000 is 30 days in seconds.
cookieMaxAge: 2592000,
cookieName: 'jwt_api_auth_token',
Expand Down Expand Up @@ -58,8 +61,12 @@ module.exports = {
'cookieName',
'cookieMaxAge',
'cookieSecure',
'defaultLang',
'isDeployed',
'isDevelopment',
'langs',
'langMap',
'rtlLangs',
],

// Content Security Policy.
Expand Down Expand Up @@ -112,10 +119,22 @@ module.exports = {
action: 'deny',
},

supportedLocales: [
'af', 'ar', 'bg', 'bn-BD', 'ca', 'cs', 'da', 'de', 'dbg', 'dbg-rtl', 'el',
// Supported languages.
langs: [
'af', 'ar', 'bg', 'bn-BD', 'ca', 'cs', 'da', 'de', 'dbl', 'dbr', 'el',
'en-GB', 'en-US', 'es', 'eu', 'fa', 'fi', 'fr', 'ga-IE', 'he', 'hu', 'id',
'it', 'ja', 'ko', 'mk', 'mn', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru', 'sk',
'sl', 'sq', 'sv-SE', 'uk', 'vi', 'zh-CN', 'zh-TW',
],
// Map of short langs to longer ones.
langMap: {
en: 'en-US',
ga: 'ga-IE',
pt: 'pt-PT',
sv: 'sv-SE',
zh: 'zh-CN',
},
rtlLangs: ['ar', 'dbr', 'fa', 'he'],
defaultLang: 'en-US',
localeDir: path.resolve(path.join(__dirname, '../locale')),
};
File renamed without changes.
129 changes: 129 additions & 0 deletions locale/dbl/LC_MESSAGES/search.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
msgid ""
msgstr ""
"Project-Id-Version: search\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2016-05-20 14:41+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
"Content-Type: text/plain; charset=utf-8\n"

#: src/core/components/LoginPage/index.js:13
msgid "Login Required"
msgstr "Ŀǿɠīƞ Řḗɋŭīřḗḓ"

#: src/core/components/LoginPage/index.js:20
msgid "You must be logged in to access this page."
msgstr "Ẏǿŭ ḿŭşŧ ƀḗ ŀǿɠɠḗḓ īƞ ŧǿ ȧƈƈḗşş ŧħīş ƥȧɠḗ."

#: src/core/components/LoginPage/index.js:24
msgid "Login"
msgstr "Ŀǿɠīƞ"

#: src/core/components/NotFound.js:8
msgid "We're sorry, but we can't find what you're looking for."
msgstr "Ẇḗ'řḗ şǿřřẏ, ƀŭŧ ẇḗ ƈȧƞ'ŧ ƒīƞḓ ẇħȧŧ ẏǿŭ'řḗ ŀǿǿķīƞɠ ƒǿř."

#: src/core/components/NotFound.js:9
msgid ""
"The page or file you requested wasn't found on our site. It's possible that "
"you\n"
"clicked a link that's out of date, or typed in the address incorrectly."
msgstr ""
"Ŧħḗ ƥȧɠḗ ǿř ƒīŀḗ ẏǿŭ řḗɋŭḗşŧḗḓ ẇȧşƞ'ŧ ƒǿŭƞḓ ǿƞ ǿŭř şīŧḗ. Īŧ'ş ƥǿşşīƀŀḗ ŧħȧŧ "
"ẏǿŭ\n"
"ƈŀīƈķḗḓ ȧ ŀīƞķ ŧħȧŧ'ş ǿŭŧ ǿƒ ḓȧŧḗ, ǿř ŧẏƥḗḓ īƞ ŧħḗ ȧḓḓřḗşş īƞƈǿřřḗƈŧŀẏ."

#: src/core/containers/HandleLogin/index.js:41
msgid "Logging you in..."
msgstr "Ŀǿɠɠīƞɠ ẏǿŭ īƞ..."

#: src/core/containers/HandleLogin/index.js:45
msgid "There was an error logging you in, please try again."
msgstr "Ŧħḗřḗ ẇȧş ȧƞ ḗřřǿř ŀǿɠɠīƞɠ ẏǿŭ īƞ, ƥŀḗȧşḗ ŧřẏ ȧɠȧīƞ."

#: src/search/components/SearchForm.js:30
msgid "Search"
msgstr "Şḗȧřƈħ"

#: src/search/components/SearchPage.js:29
msgid "Add-on Search"
msgstr "Ȧḓḓ-ǿƞ Şḗȧřƈħ"

#: src/search/components/SearchResult/index.js:18
msgid "%(count)s file"
msgid_plural "%(count)s files"
msgstr[0] "%(count)s ƒīŀḗ"
msgstr[1] "%(count)s ƒīŀḗş"

#: src/search/components/SearchResults.js:32
msgid "Your search for \"%(query)s\" returned %(count)s results."
msgstr "Ẏǿŭř şḗȧřƈħ ƒǿř \"%(query)s\" řḗŧŭřƞḗḓ %(count)s řḗşŭŀŧş."

#: src/search/components/SearchResults.js:39
msgid "Searching..."
msgstr "Şḗȧřƈħīƞɠ..."

#: src/search/components/SearchResults.js:41
msgid "No results were found for \"%(query)s\"."
msgstr "Ƞǿ řḗşŭŀŧş ẇḗřḗ ƒǿŭƞḓ ƒǿř \"%(query)s\"."

#: src/search/components/SearchResults.js:43
msgid "Please supply a valid search"
msgstr "Ƥŀḗȧşḗ şŭƥƥŀẏ ȧ ṽȧŀīḓ şḗȧřƈħ"

#: src/search/containers/AddonPage/index.js:108
msgid "Attributes"
msgstr "Ȧŧŧřīƀŭŧḗş"

#: src/search/containers/AddonPage/index.js:110
msgid "Tags"
msgstr "Ŧȧɠş"

#: src/search/containers/AddonPage/index.js:31
msgid "View on editors"
msgstr "Ṽīḗẇ ǿƞ ḗḓīŧǿřş"

#: src/search/containers/AddonPage/index.js:35
msgid "View homepage"
msgstr "Ṽīḗẇ ħǿḿḗƥȧɠḗ"

#: src/search/containers/AddonPage/index.js:41
msgid "Email support"
msgstr "Ḗḿȧīŀ şŭƥƥǿřŧ"

#: src/search/containers/AddonPage/index.js:47
msgid "View support site"
msgstr "Ṽīḗẇ şŭƥƥǿřŧ şīŧḗ"

#: src/search/containers/AddonPage/index.js:70
msgid "Current version"
msgstr "Ƈŭřřḗƞŧ ṽḗřşīǿƞ"

#: src/search/containers/AddonPage/index.js:73
msgid "View on site"
msgstr "Ṽīḗẇ ǿƞ şīŧḗ"

#: src/search/containers/AddonPage/index.js:74
msgid "Edit on site"
msgstr "Ḗḓīŧ ǿƞ şīŧḗ"

#: src/search/containers/AddonPage/index.js:76
msgid "Files"
msgstr "Ƒīŀḗş"

#: src/search/containers/AddonPage/index.js:85
msgid "Download"
msgstr "Ḓǿẇƞŀǿȧḓ"

#: src/search/containers/AddonPage/index.js:95
msgid "No current version"
msgstr "Ƞǿ ƈŭřřḗƞŧ ṽḗřşīǿƞ"

#: src/search/containers/App.js:18
msgid "Add-ons Search"
msgstr "Ȧḓḓ-ǿƞş Şḗȧřƈħ"
File renamed without changes.
129 changes: 129 additions & 0 deletions locale/dbr/LC_MESSAGES/search.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
msgid ""
msgstr ""
"Project-Id-Version: search\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2016-05-20 14:41+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
"Content-Type: text/plain; charset=utf-8\n"

#: src/core/components/LoginPage/index.js:13
msgid "Login Required"
msgstr "‮⅂oƃıu ᴚǝbnıɹǝp"

#: src/core/components/LoginPage/index.js:20
msgid "You must be logged in to access this page."
msgstr "‮⅄on ɯnsʇ qǝ ʅoƃƃǝp ıu ʇo ɐɔɔǝss ʇɥıs dɐƃǝ˙"

#: src/core/components/LoginPage/index.js:24
msgid "Login"
msgstr "‮⅂oƃıu"

#: src/core/components/NotFound.js:8
msgid "We're sorry, but we can't find what you're looking for."
msgstr "‮Mǝ,ɹǝ soɹɹʎ´ qnʇ ʍǝ ɔɐu,ʇ ɟıup ʍɥɐʇ ʎon,ɹǝ ʅooʞıuƃ ɟoɹ˙"

#: src/core/components/NotFound.js:9
msgid ""
"The page or file you requested wasn't found on our site. It's possible that "
"you\n"
"clicked a link that's out of date, or typed in the address incorrectly."
msgstr ""
"‮⊥ɥǝ dɐƃǝ oɹ ɟıʅǝ ʎon ɹǝbnǝsʇǝp ʍɐsu,ʇ ɟonup ou onɹ sıʇǝ˙ Iʇ,s dossıqʅǝ ʇɥɐʇ "
"ʎon\n"
"‮ɔʅıɔʞǝp ɐ ʅıuʞ ʇɥɐʇ,s onʇ oɟ pɐʇǝ´ oɹ ʇʎdǝp ıu ʇɥǝ ɐppɹǝss ıuɔoɹɹǝɔʇʅʎ˙"

#: src/core/containers/HandleLogin/index.js:41
msgid "Logging you in..."
msgstr "‮⅂oƃƃıuƃ ʎon ıu˙˙˙"

#: src/core/containers/HandleLogin/index.js:45
msgid "There was an error logging you in, please try again."
msgstr "‮⊥ɥǝɹǝ ʍɐs ɐu ǝɹɹoɹ ʅoƃƃıuƃ ʎon ıu´ dʅǝɐsǝ ʇɹʎ ɐƃɐıu˙"

#: src/search/components/SearchForm.js:30
msgid "Search"
msgstr "‮Sǝɐɹɔɥ"

#: src/search/components/SearchPage.js:29
msgid "Add-on Search"
msgstr "‮∀pp-ou Sǝɐɹɔɥ"

#: src/search/components/SearchResult/index.js:18
msgid "%(count)s file"
msgid_plural "%(count)s files"
msgstr[0] "%(count)s‮ ɟıʅǝ"
msgstr[1] "%(count)s‮ ɟıʅǝs"

#: src/search/components/SearchResults.js:32
msgid "Your search for \"%(query)s\" returned %(count)s results."
msgstr "‮⅄onɹ sǝɐɹɔɥ ɟoɹ „%(query)s‮„ ɹǝʇnɹuǝp %(count)s‮ ɹǝsnʅʇs˙"

#: src/search/components/SearchResults.js:39
msgid "Searching..."
msgstr "‮Sǝɐɹɔɥıuƃ˙˙˙"

#: src/search/components/SearchResults.js:41
msgid "No results were found for \"%(query)s\"."
msgstr "‮No ɹǝsnʅʇs ʍǝɹǝ ɟonup ɟoɹ „%(query)s‮„˙"

#: src/search/components/SearchResults.js:43
msgid "Please supply a valid search"
msgstr "‮Ԁʅǝɐsǝ snddʅʎ ɐ ʌɐʅıp sǝɐɹɔɥ"

#: src/search/containers/AddonPage/index.js:108
msgid "Attributes"
msgstr "‮∀ʇʇɹıqnʇǝs"

#: src/search/containers/AddonPage/index.js:110
msgid "Tags"
msgstr "‮⊥ɐƃs"

#: src/search/containers/AddonPage/index.js:31
msgid "View on editors"
msgstr "‮Ʌıǝʍ ou ǝpıʇoɹs"

#: src/search/containers/AddonPage/index.js:35
msgid "View homepage"
msgstr "‮Ʌıǝʍ ɥoɯǝdɐƃǝ"

#: src/search/containers/AddonPage/index.js:41
msgid "Email support"
msgstr "‮Ǝɯɐıʅ snddoɹʇ"

#: src/search/containers/AddonPage/index.js:47
msgid "View support site"
msgstr "‮Ʌıǝʍ snddoɹʇ sıʇǝ"

#: src/search/containers/AddonPage/index.js:70
msgid "Current version"
msgstr "‮Ↄnɹɹǝuʇ ʌǝɹsıou"

#: src/search/containers/AddonPage/index.js:73
msgid "View on site"
msgstr "‮Ʌıǝʍ ou sıʇǝ"

#: src/search/containers/AddonPage/index.js:74
msgid "Edit on site"
msgstr "‮Ǝpıʇ ou sıʇǝ"

#: src/search/containers/AddonPage/index.js:76
msgid "Files"
msgstr "‮Ⅎıʅǝs"

#: src/search/containers/AddonPage/index.js:85
msgid "Download"
msgstr "‮ᗡoʍuʅoɐp"

#: src/search/containers/AddonPage/index.js:95
msgid "No current version"
msgstr "‮No ɔnɹɹǝuʇ ʌǝɹsıou"

#: src/search/containers/App.js:18
msgid "Add-ons Search"
msgstr "‮∀pp-ous Sǝɐɹɔɥ"
Loading