Translation problems because of the way variables are written
Posted by: cheeseus (---.cooolbox.bg)
Date: January 10, 2021 12:08PM

Hello,

I have translated WampServer's UI into Bulgarian but there are a couple of problems that are the result of variables written without considering how languages other than French and English function.

My request for the developer is to modify these variables so that I can produce a grammatically correct translation into Bulgarian. These changes will NOT affect how other languages function but may require translating four of five strings (takes less than a couple of minutes).

I suspect that this also affects other languages where words are inflected depending on their syntactical role, e.g. Russian.

Explanation of the problem: It in how the "Empty logs" sub-menu is generated.

In "wampmanager.tpl", line 466 says:

Type: submenu; Caption: "${w_empty} logs"; Submenu: CleanLogFiles; Glyph: 24

The first problem is that the word "logs" is in English (not as a variable) and cannot be translated.

The second problem is in the "CleanLogFiles" variable for the submenu that is built on lines 474–476:

Type: item; Caption: "${w_empty} ${w_phpLog}"; ....\
Type: item; Caption: "${w_empty} ${w_apacheErrorLog}"; ...
Type: item; Caption: "${w_empty} ${w_apacheAccessLog}";...

So, the variable ${w_empty} is taken from the localisation file "settings_bulgarian.php" in C:\wamp64\lang\modules\ (line 86).
It is then concatenated with the variables from C:\wamp64\lang\bulgarian.lang (lines 54–56):

$w_apacheErrorLog = 'дневника за грешки на Apache';
$w_apacheAccessLog = 'дневника за достъп на Apache';
$w_phpLog = 'дневника за грешки на PHP';

What is the problem?
– Because these strings are concatenated with the "Empty" string above, they cannot start with a capital letter. Also, because the word for "log" is the sentence object in Bulgarian, it must be modified by adding a suffix, e.g. дневник > дневника.

So far, so good... However, the same three variables from above are also used stand-alone in left-click menu of WampServer, in the Help File section of the PHP, MySQL, Apache and MariaDB menus. And because I have to write the word for "log" in lowercase and suffixed so that it the sentence above is correct, they appear here the same way – starting with a lowercase letter and suffixed.

Ultimately, the translation will either be correct for the left-click menus, or for the right-click > Tools > Clean logs submenu. BUT NEVER FOR BOTH.

What am I asking for, then?

I am asking that three new variables be added to the LANG file so that I can have both the suffixed lowercase variant of the word "log" and the unsuffixed capitalised variant.

Fairly easy to implement but only the developer can do it.

Options: ReplyQuote
Re: Translation problems because of the way variables are written
Posted by: Otomatic (Moderator)
Date: January 10, 2021 04:34PM

Hi,

For the Wampserver 3.2.5 update, there will be seven new variables in the file wamp(64)\lang\modules\settings_english.php
$w_emptyLogs = 'Empty logs';
$w_emptyPHPlog = 'Empty PHP error log';
$w_emptyApaErrLog = 'Empty Apache error log';
$w_emptyApaAccLog = 'Empty Apache access log';
$w_emptyMySQLog = 'Empty MySQL log';
$w_emptyMariaLog = 'Empty MariaDB log';
$w_emptyAllLog ='Empty all log files';
This will correspond, for Bulgarian, to the file wamp(64)\lang\modules\settings_bulgarian.php

Warning :
- The language files
wamp(64)\lang\bulgarian.lang
wamp(64)\lang\modules\settings_bulgarian.php
must be encoded with Windows character set ANSI. I think 1251

- The language files
wamp(64)\www\wamplangues\add_vhost_bulgarian.php
wamp(64)\www\wamplangues\index_bulgarian.php
must be encoded utf-8

Pay attention to:
// PromptText for Aestan Tray Menu type: prompt variables
// May have \r\n for multilines

// Long texts
// Quotation marks " in texts must be escaped: \" - May have \r\n for multilines

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Translation problems because of the way variables are written
Posted by: cheeseus (---.cooolbox.bg)
Date: January 14, 2021 06:21AM

Hi Otomatic,

Thank you very much for the quick response and for the amendments.

Yes, ANSI is the correct encoding.

Here's a screenshot from my WAMP – I've been using it with my translation into Bulgarian for over one year now but I haven't shared the translation because of these problems.



After the release of the new version, I will complete my translation and share it with the world. (I only need to find out how.)

Cheers!



Edited 3 time(s). Last edit at 01/14/2021 06:29AM by cheeseus.

Options: ReplyQuote
Re: Translation problems because of the way variables are written
Posted by: Otomatic (Moderator)
Date: January 14, 2021 08:53AM

Hi,

Make a zip package of the language files and send it to me at wampserver[at]otomatic.net.

The Bulgarian language package will be integrated in the Wampserver 3.2.5 update and in the language files package permanently available at https://wampserver.aviatechno.net.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Translation problems because of the way variables are written
Posted by: Otomatic (Moderator)
Date: January 14, 2021 05:12PM

Hi,

At the beginning of the file bulgarian.lang put :

$w_translated_by = "Превод на български от Cheesus";

of course ANSI encoded.

And it will appear in the About Apps tab of Wampserver if Bulgarian is chosen as language.

Try it, it should work with Wampserver 3.2.x.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.