Nп/п : 81 из 100
 От   : Harald Oehlmann                     2:5075/128        22 сен 23 08:42:57
 К    : Alexandru                                             22 сен 23 09:47:02
 Тема : Re: Reversed translation in msgcat
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> f084c1d7
@REPLY:
<14bd951f-856c-4641-b580-51c4d0f43828n@googlegroups.com> cc7e5ef8
@REPLYADDR Harald Oehlmann <wortkarg3@yahoo.com>
@REPLYTO 2:5075/128 Harald Oehlmann
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References:
<cce3de74-4d91-475a-b45a-4ec3b25567f7n@googlegroups.com> <91c7f56e-29be-4436-9a82-c2ffe7964b36n@googlegroups.com>
<14bd951f-856c-4641-b580-51c4d0f43828n@googlegroups.com>
@TZUTC: 0200
@PID: Mozilla/5.0 (Windows NT 10.0; Win64; x64;
rv:102.0) Gecko/20100101 Thunderbird/102.15.1
@TID: FIDOGATE-5.12-ge4e8b94
Am 22.09.2023 um 08:08 schrieb Alexandru:
> rene schrieb am Freitag, 22. September 2023 um 07:52:25 UTC+2:
>> Alexandru schrieb am Donnerstag, 21. September 2023 um 19:51:57 UTC+2:
>>> Is there a way to reverse the function "mc" in msgcat?
>>> So to get the original string based on the already translated string.
 >>> The translated string was created applying the "mc" function on
the original string.
>>> Having the result of "mc" can I found out what was the original string?
>>>
>>> Many thanks
>>> Alexandru
>> AFAIK not directly.But you could intercept the msgcat::mc call like:
>>
>> rename ::msgcat::mc ::msgcat::mc1
>> proc ::msgcat::mc args {
>> set result [::msgcat::mc1 {*}$args]
>> # here you have the original $args and the translated string in $result
>> return $result
>> }
> I get it: I would have to save the results of mc to an array or dict.
> But this is not going to work for me.
> I`m supprised, that this revesed translation is not aready standard.
 > I need it to save some user settings from the GUI to a file
and the restore them from the file to the GUI.
 > Since the GUI values are translated (let`s say to German), I
don`t want to write gernan names to the file.
 > The next user might switch to English so the the saved german
words are meaningless.

Hi Alexandru,
thank you for the question.
On the practical side, msgcat maintains a dict.
You want an access function to the values and get the keys.
This is doable.

I personally only use Language Tags, e.g.
mc errFile $err

and

mcflset errFile "File error: %s"

So, this would not help you.

Take care,
Harald
 --- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
 * Origin: A noiseless patient Spider (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх