Skip navigation.
Home

Internationalisation

Why does ROX-Filer complain that my filenames aren't UTF-8?

In the past, filenames have been stored using the local character set. This means that you can't send a file to someone in a different locale or have two files from different character sets on your system at once.

Therefore, there is a general move over to the UTF-8 encoding (which can represent all characters in a single encoding). Many applications (not just ROX ones) now assume that your filenames are UTF-8 and will complain if not. ROX-Filer displays names not in UTF-8 in red.

You can specify a fall-back encoding by setting the CHARSET environment variable. Use something like this to test it (-n forces a new copy of the filer to start):

CHARSET=iso-8859-2 rox -n

A better solution for the future is to convert your filenames to UTF-8 (use the filer's Rename box to convert individual files, or the iconv utility for mass conversion). You can use UTF-8 names from the shell by setting LANG, for example:

LANG=en_GB.UTF-8 xterm

For more information, see the httpUTF-8 and Unicode FAQ for Unix/Linux.

Why doesn't ROX-Filer provide the option to use my local encoding?

ROX-Filer only supports non-UTF-8 encodings enough to let you rename your files to UTF-8. Although we often get requests to add more support, this is not a useful direction. There are a huge number of places where support must be added, and even if you got the whole filer converted, you'd need to convert all your other applications too.

And, at the end of all this work converting everything to support your legacy encoding, you're just back to the bad old pre-UTF-8 days, where you can't exchange files with users in a different locale, can't have files with different alphabets on the same system, and you have to keep track of the encodings whereever you go, or the names become unreadable. So, just convert to UTF-8. It's easier in the long run!

How do I translate a program into another language?

If the program already supports translations, you can just copy an existing translation (eg, copy Messages/fr.po as Messages/de.po). Edit the file in your favourite text editor, then run ./dist to generate the output .gmo file and restart the application.

If the application doesn't yet support translations then do the following (for ROX-Lib python applications):

  1. In the AppRun file, add this just after 'import rox':

    import os
    __builtins__._ = rox.i18n.translation(os.path.join(rox.app_dir, 'Messages'))

    Note: you don't need to do this in every file, just the first one that gets run.

  2. Mark any strings that should be translated with _():
    rox.info("Hello World")

    becomes
    rox.info(_("Hello World"))
    Be sure not to mark anything else, or the program may not work correctly.

  3. Run 'pygettext *.py' to create 'messages.pot'.
  4. Create a 'Messages' subdirectory. Copy messages.pot as Messages/<lang>.po.
  5. Edit the new .po file so that each English string is followed by its translation.
    Note: be sure to set the charset to utf-8.
  6. Copy dist and update-po from Edit/Messages to there.
  7. Run './dist' to generate the .gmo files.

See also the ROX-Lib i18n documentation.

UTF-8 is also sometimes called utf8 (for searching).

See GIT for translators for instructions on how to send us your changes.

Syndicate content