Skip to content

Updating a Translation

Craig Knudsen edited this page Nov 21, 2018 · 2 revisions

Updating a translation of WebCalendar is actually pretty simple. Just open up the translation file in the translations directory with your favorite text editor (like vi, vim, emacs, pico, Notepad, etc.). In particular look for places where missing translations are indicated. The general format of the translation lines are English text followed by a ':' and then the translated text. All lines that start with '#' are considered a comment. For example:

    # Example translation
    Hello: Hola

Be sure to start with the most recent version of the translation. You can download the most recent verison of the translations from the github repo.

Missing translations may be marked with a "<< MISSING >>" note. and typically the English version of the translation will also be included on the following line (as in the example below where the word "Edit" has not yet been translated).:

    # << MISSING >>
    # Edit:
    #

If this is not the case, you can use the update_translation.pl perl script to add the "MISSING" tags for you. In the example below, we are adding the "MISSING" tags to the French translation.

    cd tools
    perl update_translation.pl French.txt

For some text, an abbreviation may be used rather than the English text. In those cases, the full text will be noted as in the following example:

    # << MISSING >>
    # custom-script-help:
    # English text: Allows entry of custom Javascript or stylesheet text that
    # will be inserted into the HTML "head" section of every page.
    #

Note that there a few "special" translations. There are not translations from English into another language. Instead, they are settings for the language. The first is "charset" which specifies which character set to use with the translation. This is typically found near the top of the translation file:

    # charset for this language
    charset: UTF-8

Next, you will find entries for date/time format preferences for the language. To not change the default setting, the translation should appear as '=', which means use the default. Here is an example of the date/time preferences in a translations:

    # date/time preferences
    __mm__/__dd__/__yyyy__: =
    __month__ __dd__: =
    __month__ __dd__, __yyyy__: =
    __month__ __yyyy__: =

When you're done making changes, move into the tools directory. Run the check_translation.pl script on your new data file to make sure you have all the needed translations:

    perl check_translation.pl French.txt

Create a pull request for your translation (or just email me the .txt file), and your translation will then be included in the next release of WebCalendar.

Clone this wiki locally