[Gambas-user] Some questions about project Translation

Sebastian Kulesz sebikul at ...626...
Sun Sep 23 19:31:50 CEST 2012


On Sun, Sep 23, 2012 at 1:08 PM, RICHARD WALKER
<richard.j.walker at ...247...> wrote:
> Greetings to all,
>
> I have been experimenting with the Translate option in the IDE. Just
> for fun, I took a current mini-project which is nearing completion and
> marked it up for translation. At only 116 strings it is not too
> daunting a task. To make it even easier I elected to start with a
> translation from English to American.
>
> In my first attempt I used the "This string must not be translated"
> option ("-") rather a lot. I noticed that there are actually many
> little strings which should not be translated whatever the target
> language might be. Typical of these are short strings like "flac" or
> "mp3" which find their way into the list, but may be regarded as
> invariant.
>
> I tried again using the "Copy untranslated string" option and used "-"
> for the aforementioned little strings and some other abbreviations and
> the program name.
>
> Then I noticed some repetitive phrases like "Click to enable [some
> feature or other]", and their "disable" counterparts.
>
>                                                          -=o0o=-
>
> So I was wondering, does it make sense to re-code a project so that
> strings, or string constants are used for repeated fragments of text?
> Might such an approach actually make it harder to translate
> "sentences" made of these fragments into some languages?

Normally, you should avoid this. If you have string like:

Are you sure you want to $action this?

$action being move, delete, copy, etc. You should keep the repeated
strings. Different languages have different syntactic order, having a
generic string can be really hard to translate if there is a specific
language that uses a different order for different possible $actions.

>
> As an alternative, does the translation mechanism used have any sort
> of dictionary of phrases? For example, in a form design I may set some
> text as a tool-tip. In the program I may alter the tool-tip and later
> restore its original text. That could give me two or more instances of
> the same text to translate.

The translation template is regenerated each time the project is
compiled. So if you later change a previously translated string, you
would loose that translation. There is no "translation memory" at this
time.

>
> What is the "correct" way to use the "-" translation option? Is it
> preferable to find the occurrences of the short strings I identified
> and find a way to keep them from being listed for translation? I
> realise that the project is scanned and the "from" list is built for
> each translation episode so using "-" to mark strings to be preserved
> whatever the target language is a step which must be taken for each
> translation. Is there a need for a markup in the project to say "never
> translate" so that these strings are automatically given the "-"
> translation?

There is nothing bad about having 90% of your strings marked as
non-translatable. Most of the time this happens because the text is
embedded in the form code, and not inside a class or a module. There
is, though, a property that some object share in the forms that
prevent them from being added to the translation template, and thus
are only printed verbatim.

>
> And finally, in examining my code for translatable strings I realised
> that I had made extensive and vital use of text written by various
> shell commands and captured for analysis/action in various Process
> Read and Error handlers. That started me wondering how to handle this
> situation in another language where the text written by these
> processes would likely be very different from what I was expecting.
> Any ideas?

The best solution would be to force the use of the English language by
setting the environmental variable LANGUAGE.

You can do that like this:
Shell "LANGUAGE=en firefox" to sOutput

If you want this to persist, you can create a virtual terminal inside
a process instance and execute (i did not test this, but it should
work) before any other command:
Print #hProcess, "export LANGUAGE=en"

Hope this helps you!

>
> I welcome any opinions from people who have made more extensive use of
> the Gambas IDE Project Translate option than I have.
>
> Richard
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user




More information about the User mailing list