Jump to content
The Dark Mod Forums

Recommended Posts

Posted

To give you an idea of what I looking at for Group 3, much of what I want to cover are strings that will be more consistently translated if properly grouped, rather than the order they appear in all.lang [English]. I'm trying YAML as the light-weight structuring mechanism. A hand-built draft of Settings is mostly done. Here's a small example of that:

Fragment within the yaml hierarchy main_menu:/settings_page_layout:/body_settings:/

      video:
        # In main_menu_video.gui, unless indicated otherwise...
        general:
        - subheading:
          - line_1:
            - phrase_id: "#str_02298"
              phrase_en: "Changes to screen size & aspect ratio, or full screen require a restart."
          - line_2:
            - phrase_id: "#str_02299"
              phrase_en: "Fullscreen is Desktop Resolution, use Render Scale to adjust"
        - setting_row_1:
          - label_id: "#str_02154"
            label_en: "Fullscreen"
          - choice_id: "#str_04222"
            choice_en: "Windowed;Fullscreen;Borderless"
          - tooltip_id: "#str_menu_fullscreen_tooltip"
            tooltip_en: "Windowed: normal window of any size\nBorderless: covers whole screen, fast switching\nFullscreen: exclusive, can change resolution"

I'm new to YAML, so I may not have the structure quite right yet (e.g., when to use "-").

  • Like 1
Posted

Hmm, if so, I didn't see the memo... wouldn't be the first time. 🤔

Going to all named strings is a whole lot of work, but would greatly aid DR and string maintenance. And if already completed would simplify and improve further translations

Posted

@Geep, doing massive restructure on old state is not a good idea.
Since you are marked as Contributor, don't you have direct SVN access to the assets repo?
If no, we should simply give you the access.

I can't say I see anything still used in your list to be deleted.
Usually the best way to check is to search over guis/ + scripts/ + maybe C++ code.
Feel free to delete unused and reorder the lines in the strings file.

I don't really like the yaml idea, because you are basically trying to extend the already overly massive strings framework.
Now we have tons of old Perl code that nobody wants to mess with, and you'll add some more code which nobody will want to mess with a few years later? And what will yaml give you, really?

If you reorder the lines in the existing format, you will get the grouping you want. The current order is messy simply because everyone is lazy to search for similar / related strings every time they want to add a new menu settings. And I'm afraid things will stay this way. Even if you make perfect order, it will slowly rot over time.

Finally, here are some of my thoughts regarding strings framework:

  1. I would be happy to make all.lang the only file with strings, encoded in UTF-8. The engine should read it directly and use per-language table to convert permitted UTF-8 characters into its weird 8-bit encoding which is uses now (without generic UTF-8 decoding). This way we can finally get rid of the old Perl stuff.
  2. The strings file should support full-text replacements in addition to placeholder replacements we have now. That would allow translators to translate a mission without forcing the author to turn it into a total mess which is harder to work with. The full-text replacements should be used for missions, placeholders should be used for core.

The p.1 idea will require changes in the engine, but I think they are quite lightweight. Reading UTF8->8-bit character table per language, and convert UTF-8 into native format when strings are loaded. What scares me more is trying to understand how it works now and constructing these new tables.

  • Like 1
Posted

@stgatilov, I was NOT proposing renaming all the numbered strings to alphanumeric (even though that would likely slow down the ordering rot you mentioned.) I was just responding to @wesp5 hearing that someone was already planning on doing so, which surprised me.

Yes, I do have access to the SVN repo, thanks. I just try to avoid it as much as possible. For the current work, I'm using 2.14 as the stable base line (for .cpp code, all.lang, *.gui*, etc.) , because things are complicated enough as is.

The yaml is just an organizing tool that "might" be helpful for my AI translation efforts, because it can formally encode relationships between strings. Not sure about usefulness yet. I'm not proposing that the TDM engine should read it.

I could reorganize at least parts of all.lang similarly, if everyone's OK with moving further away from alphanumeric ordering of #str_ids.

The two ideas for improving strings I'm also on-board with. Particularly for #1, which I've also floated as a trial balloon in the past. BTW, for that, my gen_lang_plus has related C++ code that might be of some interest (albeit doesn't use the idTech4 class structure and is Windows-based).

For #2, I can see some disambiguation problems, but nothing insurmountable. Given that DR will never properly support #str_ids, seems reasonable.

What time frame are you thinking about for these?

 

  • Like 1
Posted

Speaking of gen_lang_plus, I just recycled some its code to make a visualization tool "pivot_all_lang" for me to see all the translations of a given string together. Basically, it pivots data like...

[English]
    "#str_02001"    "Warning"
    "#str_02000"    "Error"    // comment with english
    "#str_02002"    "Connection Error."
[French]
    "#str_02001"    "Warning French"
    "#str_02000"    "Error French"    // comment with french
    "#str_02002"    "Connection Error French."

into this form...

    "#str_02000_english"    "Error"    // comment with english
    "#str_02000_french"    "Error French"    // comment with french

    "#str_02001_english"    "Warning"
    "#str_02001_french"    "Warning French"

    "#str_02002_english"    "Connection Error."
    "#str_02002_french"    "Connection Error French."

I've fed this with all.lang of 2.14, and here is the resulting "all_lang_pivot.txt" (about 800 KB). There are some added flags, which you can read about in the file preamble. Eventually I'll post the code + wiki description. For now, the output file:

https://drive.google.com/file/d/1BDz-DWe62NTGMA0dxdngnepagi3dwTNQ/view?usp=sharing

Posted
42 minutes ago, datiswous said:

Why is that?

From what I could glean from old forum posts (mostly before my time), strong dislike of the #str methodolgy.

Posted
2 hours ago, Geep said:

@stgatilov, I was NOT proposing renaming all the numbered strings to alphanumeric (even though that would likely slow down the ordering rot you mentioned.) I was just responding to @wesp5 hearing that someone was already planning on doing so, which surprised me.

Right now we just make new placeholders string-based, but I guess nobody wants to do massive renaming of existing ones.

Quote

Yes, I do have access to the SVN repo, thanks. I just try to avoid it as much as possible. For the current work, I'm using 2.14 as the stable base line (for .cpp code, all.lang, *.gui*, etc.) , because things are complicated enough as is.

The problem is that if you massively reorder the strings and someone adds new strings in trunk, then those new strings will probably we dropped. Basically, any massive change either on trunk or on your side makes it unmergeable in the future.

Quote

What time frame are you thinking about for these?

I guess I'd better start with UTF-8 part. I really want to make the basic operation Perl-free.
As far as I understand, there is no need to change format: all.lang should be perfectly consumable as it is.
I think 2 weekends should be enough, but the next one I'll be on vacation... so should be ready in September, I suppose?...

As for the full-text replacements... I think it will be clear after the first part is done.
It will require some kind of format extension, so it is hard to predict.

1 hour ago, Geep said:

Speaking of gen_lang_plus, I just recycled some its code to make a visualization tool "pivot_all_lang" for me to see all the translations of a given string together. Basically, it pivots data like...

Mmmm... maybe we can reorder all.lang without breaking anything:

[English] "#str_02001"    "Warning"
[French] "#str_02001"    "Warning French"

[English] "#str_02000"    "Error"    // comment with english
[French] "#str_02000"    "Error French"    // comment with french

[English] "#str_02002"    "Connection Error."
[French] "#str_02002"    "Connection Error French."

Depending on how the parser was implemented originally, TDM might eat it fine, and you'll have this grouping.
Isn't it better for everyone, no?

Posted
5 hours ago, Geep said:

From what I could glean from old forum posts (mostly before my time), strong dislike of the #str methodolgy.

Well DR is currently being worked on by a new guy.

Posted
15 hours ago, stgatilov said:

The problem is that if you massively reorder the strings and someone adds new strings in trunk, then those new strings will probably we dropped.

Towards the end of whatever I do with all.lang for 2.15, it would of course be necessary to check if any new strings have been added by others, and incorporate them. I would then make a bugtracker request for someone (who likes working with revision control systems) to assist the effort by adding the finalized file to the RCS.

Posted
16 hours ago, stgatilov said:

Depending on how the parser was implemented originally, TDM might eat it fine, and you'll have this grouping.
Isn't it better for everyone, no?

I don't know whether or not an average human translator for a particular language would prefer this pivoted file as the working file. Maybe breaking it up into less-sprawing subset files, e.g. french.lang as a UTF-8 file with JUST the pivoted english and french strings, no other languages. (and with all comments, not just the trailing-line ones that all_lang_pivot.txt retains).

 

Posted
12 hours ago, datiswous said:

Well DR is currently being worked on by a new guy.

Always good to get fresh blood. 🩸

Posted
16 hours ago, stgatilov said:

so should be ready in September, I suppose?...

Hmm, sounds optimistic. The UTF8 to Latin-x conversions may take some time. My code uses some Windows-specific techniques, which probably need something different for your purposes.

Posted

I'm going back to work on my OP item 2b (new strings translated by AI).

I hope the pivoted file can help build a targeted glossary of a few select TDM terms in multiple languages.  I could then include that glossary in a multi-language AI translation prompt for the new strings.

After 2b is done, I'll probably postpone OP item 3, to consider reordering parts of all.lang (similar to yaml). Do the [English] part by hand, and ask AI to reorder the rest?

Posted

Looking at the hard-coded strings for which I offered new #str_id's, I decided to generate language strings for
just this item first:

 // In mainmenu_settings_controls.gui; appears as Settings/Controls/General/row 2
    "#str_menu_toggle_creep"    "Toggle Creep"    // Controls/General
//    "Disabled;Enabled"

The setting means (briefly) "change the Creep key from hold-to-use mode to press-to-toggle mode". Creep itself means move slowly (and steathly).

A challenge is that there are already translations for the "Creep" keybind setting, which it would be good to be consistent with to the extent possible:

Glossary for "#str_02422" "Creep" [English]:
    "Schleichen" [German]
    "Avancer lentement" [French]
    "Skradanie" [Polish]
    "Arrampicati" [Italian]
    "Sigiloso" [Spanish]
    "Mover-se sorrateiramente" [Portuguese]
    "Красться" [Russian]
    "Plížení" [Czech]
    "Araszolás" [Hungarian]
    "Plížiť sa" [Slovak]
    "Kryb" [Danish]
    "Furisarea" [Romanian]
    "Sürünme" [Turkish]
    "Sigilós" [Catalan]

For the "Toggle..." aspect, there are similar reference lists, e.g. "Toggle Crouch" vs "Crouch".

A constraint is that "Toggle Creep" is a Setting prompt, so the space for any translation is delimited.
I estimated that generally for Setting prompts, an appropriate string length upper limit would be
22 characters (including space & punctuation).

I prompted ChatGPT with the foregoing information (and general context about this being for a PC game platform). Several iterations were involved. Because of the character limit, some other synonyms were used in some cases, e.g.: "switch" or "alternate" for "toggle"; "move furtively" for "move slowly". To have consistency, the "Creep" string itself would need to change for several languages. Overall results:

For "Toggle Creep"...
German:      Schleichen umschalten
French:      Basculer marche lente
Polish:      Przełącz skradanie
Italian:     Alterna furtività
Spanish:     Alternar sigiloso
Portuguese:  Alternar furtividade
Russian:     Переключить 'Красться'    (here, single quotes replace the angle quotes that are not in TDM's char set.)
Czech:       Přepnout plížení
Hungarian:   Araszolás ki/be
Slovak:      Prepínanie plíženia
Danish:      Kryb til/fra
Romanian:    Comută Furisarea
Turkish:     Sürünmeyi aç/kapat
Catalan:     Alternar Sigilós
Dutch:    Sluipen schakelen
Swedish:    Växla smygning

Translation adds for "#str_02422"    "Creep"
Swedish:    Smyga
Dutch:    Sluipen

Translation changes for "#str_02422"    "Creep" (to better match Toggle Creep, and so allow latter to be 22 chars max)
French:    Avancer lentement -> Marche lente
Italian*:    Arrampicati -> Furtività
Portuguese:    Mover-se sorrateiramente -> Furtividade

* The word Arrampicati means "climb!", and seems wrong. Maybe this was supposed to be applied to the "Mantle" keybind setting

So, this is a slow process so far.

Posted

As suspected, Mantle and Creep were both translated in Italian as Arrampicati. Fixed. Foregoing all added to my all.lang WIP.

Posted

I got stuck on these two:

	"#str_02480"	"Sloven®ina"		// Slovak (® in ISO-8859-1 is č in our font)
	"#str_02481"	"Sloven¨®ina"		// Slovenian (southern slovenia) (¨ => š)

I believe Slovenia and Slovakia are two different countries, so the comments here are confusing.

I see that #str_02481 is not used anywhere.
In the code #str_2480 is used, and all the variable/filenames and comments call it "slovak".

The specific trouble for me is that this special doublequote symbol (code 168) is mapped to ? (question mark) in French, and the normal ? is also mapped to ?. So I get as situation that two UTF-8 characters are both mapped to question mark in French. I think I can just delete #str_2481.

But I'm now worried about general confusion.
Should we rename "slovak" to "slovenian" in the code and filenames?
I don't see any "slovak.lang" files in existing missions, so it should not break anything.

UPDATE: Here is the full list of UTF-8 characters which are mapped to the same character:

Lang "hungarian" key "#str_01050": char "63" obtained from both "{'õ'}" and "û"
Lang "hungarian" key "#str_02010": char "63" obtained from both "{'û', 'õ'}" and "?"
Lang "hungarian" key "#str_02462": char "63" obtained from both "{'?', 'û', 'õ'}" and "ñ"
Lang "hungarian" key "#str_02464": char "63" obtained from both "{'?', 'û', 'ñ', 'õ'}" and "ê"
Lang "hungarian" key "#str_02467": char "63" obtained from both "{'?', 'ê', 'ñ', 'û', 'õ'}" and "¬"
Lang "hungarian" key "#str_02469": char "63" obtained from both "{'?', 'ê', 'ñ', 'û', 'õ', '¬'}" and "à"
Lang "hungarian" key "#str_02480": char "63" obtained from both "{'à', '?', 'ê', 'ñ', 'û', 'õ', '¬'}" and "®"
Lang "hungarian" key "#str_08326": char "63" obtained from both "{'à', '?', '®', 'ê', 'ñ', 'û', 'õ', '¬'}" and "Õ"
Lang "slovak" key "#str_02462": char "63" obtained from both "{'?'}" and "ñ"
Lang "slovak" key "#str_02464": char "63" obtained from both "{'?', 'ñ'}" and "ê"
Lang "slovak" key "#str_02467": char "63" obtained from both "{'?', 'ñ', 'ê'}" and "¬"
Lang "slovak" key "#str_02469": char "63" obtained from both "{'?', 'ñ', '¬', 'ê'}" and "à"
Lang "slovak" key "#str_02480": char "63" obtained from both "{'à', '?', 'ñ', 'ê', '¬'}" and "®"
Lang "swedish" key "#str_02467": char "63" obtained from both "{'˝'}" and "Č"
Lang "swedish" key "#str_02480": char "63" obtained from both "{'˝', 'Č'}" and "č"

So I guess the script just replaces chars that it does not knowing specific language with question mark. Maybe simply allow it?

I think the general practice of trying to display the language names in its native language regardless of which language is active is bad, especially given that engine is not capable of displaying all the characters with each language. We should localize language names, i.e. display Russian as "русский" only when Russian is active, but "Russian" when English is active, "Rússo" in Portuguese, "Ruski" in Serbian, etc.

The user has to know a bit of English anyway in order to navigate through settings, and I believe everyone capable of downloading TDM already knows the name of his language in English.

Posted
15 hours ago, stgatilov said:

So I guess the script just replaces chars that it does not knowing specific language with question mark. Maybe simply allow it?

Yes. In my code (gen_lang_plus/UTF8_8859_Convert.cpp) I have screening routines that convert ALL possible UTF8 codes that are not in the target Latin-x to "?". This is defensive programming in case the translator is less aware of restrictions.

Let me look into that Slovak/Slovenia a bit.

Posted

ChatGPT confirms a sample of the strings in [Slovak] are indeed what's call "Slovak" in English. And further, in the Slovak language, “Slovak” (the language) is "Slovenčina". So the current main menu presentation is correct & consistent.

I agree that this can be commented out:

"#str_02481"	"Sloven¨®ina"		// Slovenian (southern slovenia) (¨ => š)
  • Thanks 1
Posted
16 hours ago, stgatilov said:

I think the general practice of trying to display the language names in its native language regardless of which language is active is bad, especially given that engine is not capable of displaying all the characters with each language. We should localize language names, i.e. display Russian as "русский" only when Russian is active, but "Russian" when English is active, "Rússo" in Portuguese, "Ruski" in Serbian, etc.

The user has to know a bit of English anyway in order to navigate through settings, and I believe everyone capable of downloading TDM already knows the name of his language in English.

I certainly recognize the general technical drawbacks (see my "MultiLanguage Display" wiki article), but disagree that offering the user his own language name is a bad idea. Given that we currently have the language page working good enough, I don't see the need for change. (And I dream of a distant time when both TDM and the DAT font format can handle UTF8 natively within.)

Certainly navigation through settings in other languages can be improved. I hope to make some headway on that.

Posted
10 minutes ago, Geep said:

I certainly recognize the general technical drawbacks (see my "MultiLanguage Display" wiki article), but disagree that offering the user his own language name is a bad idea. Given that we currently have the language page working good enough, I don't see the need for change. (And I dream of a distant time when both TDM and the DAT font format can handle UTF8 natively within.)

I don't think it is okay for randomly force non-native letters onto languages.
For instance, there are 8 non-ASCII letters in the English set now.
Isn't it that every language has its own font texture?

{
    char 0xC2 0xAC : 0xAC             // ¬ -> ¬
    char 0xC2 0xAE : 0xAE             // ® -> ®
    char 0xC3 0xA0 : 0xE0             // à -> à
    char 0xC3 0xA2 : 0xE2             // â -> â
    char 0xC3 0xA7 : 0xE7             // ç -> ç
    char 0xC3 0xAA : 0xEA             // ê -> ê
    char 0xC3 0xB1 : 0xF1             // ñ -> ñ
    char 0xC3 0xBC : 0xFC             // ü -> ü
}
Posted

Anyway, the more important question is: do we want to change the format of UTF-8 strings file?

I mean the all.lang file can be renamed into all.utf8lang and consumed directly by the engine.
However, its format might seem a little bit... hard to extend.
Every line is just assumed to have two strings with fixed meaning.

Perhaps we want to add a keyword at the beginning of every line?
Something like this:

{
    language "english"
    map_key "#str_02050" "Byte"
    language "russian"
    map_key "#str_02050" "Байт"
    map_text "Unable to save" "Не удалось сохранить"
}

Here "map_key" is the old thing, "language" is just the more parser-friendly version of [Language], and "map_text" is potentially the command for writing full-text replacements.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Ansome

      Terribly difficult juggling map designing with work, but I'm still alive and chipping away at something very special. I'm actually making a collaboration of sorts with a friend, I make the map itself and he acts as my "Chief Scope Creep Consultant" that checks in every so often to make sure this project isn't getting out of hand. It's a good system!
      · 0 replies
    • JackFarmer

      We don't need artificial intelligence; we need artistic intelligence. 
      Ralf Hütter, Kraftwerk
      · 5 replies
    • taaaki

      The post editor for the dark themes should be working again. Apologies for the inconvenience.
      · 1 reply
    • jaxa

      Talk GabeCube:
      https://forums.thedarkmod.com/index.php?/topic/18055-2016-cpugpu-news/page/39/#findComment-508710
      · 3 replies
    • The Black Arrow

      Things have been so bad these days for me...
      Just a year ago, I've been feeling dizzy, I thought it was nothing, today's stress, that type of thing, went to sleep...Still dizzy! 9 more days dizzy, went to doctor (I would have gone on the first day if NOT for the long appointment time)
      Said it may be Neck Dizziness...I did exercises for 6 months, no changes.
      Went to a Physical Therapist, went to another, no changes.
      I've asked my doctor for a full check this time.
      I hated yesteryear so much due to personal reasons, this year might be the same.
      To be brutally honest, I'd rather have cancer or/and chronic pain than suffer dizziness any second longer, especially when nothing helps.
      Hard to enjoy Thief when you're dizzy so I was hoping this year, Winter will be best for me.
      · 7 replies
×
×
  • Create New...