cryptpad/www/common/translations
Weblate ef56a8f863 Translated using Weblate (Japanese)
Currently translated at 99.8% (1377 of 1379 strings)

Translation: CryptPad/App
Translate-URL: http://weblate.cryptpad.fr/projects/cryptpad/app/ja/
2021-07-27 17:47:04 +02:00
..
archive replace two empty translation files whose removal triggered errors 2021-06-24 12:51:52 +05:30
messages.ar.json replace two empty translation files whose removal triggered errors 2021-06-24 12:51:52 +05:30
messages.ca.json Translated using Weblate (Catalan) 2021-07-12 06:18:18 +02:00
messages.cs.json Translated using Weblate (Czech) 2021-05-26 17:45:22 +02:00
messages.de.json Translated using Weblate (German) 2021-07-27 17:47:04 +02:00
messages.el.json remove blog link from out-of-date translations 2021-07-01 12:46:43 +05:30
messages.es.json set a generic documentation link in translations 2021-07-01 11:46:56 +05:30
messages.fi.json set a generic documentation link in translations 2021-07-01 11:46:56 +05:30
messages.fr.json Translated using Weblate (French) 2021-07-27 17:47:04 +02:00
messages.hi.json Translated using Weblate (Hindi) 2021-07-09 11:34:47 +02:00
messages.id.json Translated using Weblate (Indonesian) 2021-05-28 12:08:18 +02:00
messages.it.json remove blog link from out-of-date translations 2021-07-01 12:46:43 +05:30
messages.ja.json Translated using Weblate (Japanese) 2021-07-27 17:47:04 +02:00
messages.json Translated using Weblate (English) 2021-07-27 01:23:51 +02:00
messages.lt.json Translated using Weblate (Lithuanian) 2021-07-24 13:30:03 +02:00
messages.nb.json Update translation files 2021-05-05 06:55:31 +02:00
messages.nl.json set a generic documentation link in translations 2021-07-01 11:46:56 +05:30
messages.pl.json remove unused keys and update keys containing HTML 2021-04-09 17:31:24 +05:30
messages.pt-br.json Translated using Weblate (Portuguese (Brazil)) 2021-07-05 12:54:36 +02:00
messages.ro.json remove blog link from out-of-date translations 2021-07-01 12:46:43 +05:30
messages.ru.json remove blog link from out-of-date translations 2021-07-01 12:46:43 +05:30
messages.sv.json Update translation files 2021-04-09 14:06:02 +02:00
messages.th.json add Thai translation file 2021-06-24 10:03:58 +05:30
messages.tr.json Update translation files 2021-04-09 14:06:02 +02:00
messages.zh.json Translated using Weblate (Chinese (Simplified)) 2021-07-24 13:30:04 +02:00
README.md Make customized translations more maintainable 2018-10-15 18:38:41 +02:00

Adding Translations

To illustrate the process of translating, this guide will make an english-pirate translation of Cryptpad. We'll assume that you have a work locally-installed, properly functioning installation of Cryptpad. If you don't have Cryptpad installed locally, start by following the steps in the main readme.

Getting started

Once everything is working, copy the default (English) source file (/www/common/translations/messages.js) to a file named according to your language's ISO 639-1 Code, like /www/common/translations/messages.fr.js. There is no ISO 639-1 language code for English-pirate, so we'll just call it messages.pirate.js.

cd www/common/translations/
cp messages.js messages.pirate.js

Including your translation

To include your translation in the list, you'll need to add it to /customize.dist/messages.js. There are comments indicating what to modify in three places:

(function () {
// add your module to this map so it gets used
// please use the translated name of your language ("Français" and not "French")
var map = {
    'fr': 'Français',
    'es': 'Español',
    'pl': 'Polski',
    'de': 'Deutsch',
    'pt-br': 'Português do Brasil',
    'ro': 'Română',
    'zh': '繁體中文',
    'el': 'Ελληνικά',
};

We need to modify that map to include our translation:

(function () {
// add your module to this map so it gets used
// please use the translated name of your language ("Français" and not "French")
var map = {
    'fr': 'Français',
    'es': 'Español',
    'pl': 'Polski',
    'de': 'Deutsch',
    'pt-br': 'Português do Brasil',
    'ro': 'Română',
    'zh': '繁體中文',
    'el': 'Ελληνικά',
    'pirate': 'English Pirate', // add our module to the map of languages
};

Just add your module in a similar fashion to the existing translations, save your changes, and close /customize.dist/messages.js.

You also need to add a customizable version of you translation. To do so, make a copy of the file /customize.dist/translations/messages.js with your translation name (messages.pirate.js in our case), and change its content to load the correct language file:

/*
 * You can override the translation text using this file.
 * The recommended method is to make a copy of this file (/customize.dist/translations/messages.{LANG}.js)
   in a 'customize' directory (/customize/translations/messages.{LANG}.js).
 * If you want to check all the existing translation keys, you can open the internal language file
   but you should not change it directly (/common/translations/messages.{LANG}.js)
*/
define(['/common/translations/messages.pirate.js'], function (Messages) { // Change the file name here
    // Replace the existing keys (in your copied file) here:
    // Messages.button_newpad = "New Rich Text Document";
    return Messages;
});

That's all!

Actually translating content

Now we can go back to our file, /www/common/translations/messages.pirate.js and start to add our Pirate-language customizations.

Open the translation file you created in /customize.dist/translations/. You should see something like:

define(function () {
    var out = {};

    out.main_title = "Cryptpad: Zero Knowledge, Collaborative Real Time Editing";

Now you just need to work through this file, updating the strings like so:

define(function () {
    var out = {};

    out.main_title = "Cryptpad: Knowledge lost at sea while ye scribble with yer mateys";

It's important that you modify just the string, and not the variable name which is used to access its content. For instance, changing main_title to mainTitle would make the translated string inaccessible to the rest of the codebase.

If a key is not found in your translation, the default English version of that key will be used. This is to make sure that buttons and other interface elements are not empty, but it's obviously not ideal.

Verifying Your Translations

It's advisable to save your translation file frequently, and reload Cryptpad in your browser to check that there are no errors in your translation file. If there are any errors in your code, the file will fail to parse, and the page will no load correctly.

Checking frequently will make it easier to know which change caused the error.

Additionally, we advise using the apps and visiting the various pages, to make sure that your translations make sense in context.

When you're happy with your translation file, you can visit http://localhost:3000/assert/translations/ to view Cryptpad's tests. These tests will check to make sure that your translation has an entry for every entry in the default English translation.

Getting Help

If you have any issues, reach out via any of the methods listed in the readme under Contacting Us. We're happy to help.

Deleting a translation

When a key is nolonger used (such as presentSuccess) you can delete it using this bash one-liner.

( export KEY=presentSuccess && grep -nr "$KEY" ./www/common/translations/ | sed 's/:.*$//' | while read x; do sed -i -e "/out\.$KEY =/d" $x; done )