Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[idea] change format to gettext po files #791

Open
mithrand0 opened this issue Apr 8, 2023 · 3 comments
Open

[idea] change format to gettext po files #791

mithrand0 opened this issue Apr 8, 2023 · 3 comments
Labels
enhancement New feature or request proposal This issue needs discussion before it can be implemented.

Comments

@mithrand0
Copy link
Contributor

mithrand0 commented Apr 8, 2023

An idea I am playing with is to change the translation format to Gettext, to support editing with Poedit, or WebLate.

Gettext is one of the-facto standards in the industry. Programs like Poedit make it easier for translators to translate, and also makes is possible for a lot of utilities to integrate with. We can generate Valve KV files from gettext files.

It's just an idea. I can make the arrangements if needed.

@mithrand0 mithrand0 added enhancement New feature or request proposal This issue needs discussion before it can be implemented. labels Apr 8, 2023
@mithrand0 mithrand0 changed the title [idea] change format to Poedit [idea] change format to gettext Apr 8, 2023
@mithrand0 mithrand0 changed the title [idea] change format to gettext [idea] change format to gettext mo files Apr 8, 2023
@mithrand0 mithrand0 changed the title [idea] change format to gettext mo files [idea] change format to gettext po files Apr 8, 2023
@BenLubar
Copy link
Contributor

BenLubar commented Apr 8, 2023

I'm looking at the gettext documentation and it doesn't seem like it supports any of the three(?) placeholder formats we use, %s1, %[1]s, and %first_value%.

The only other problem I can think of between converting back and forth is that gettext uses the source string as the key, so we'd have to figure out some way to handle multiple strings being able to have the same source with different notes.

We can't use gettext in the game because libgettext is GPL, but we can use it as an intermediary format.

@BenLubar
Copy link
Contributor

BenLubar commented Apr 8, 2023

looks like the latter problem is already common enough to have documentation: https://docs.weblate.org/en/latest/formats.html#mono-gettext

@BenLubar
Copy link
Contributor

BenLubar commented Apr 8, 2023

Just a quick inventory on the files we have:

// VDF TRANSLATION FILES
//
// achievements/563560_loc_{lang}.vdf (derived, not translated separately)
// addons/*/resource/closecaption_{lang}.txt
// addons/*/resource/reactivedrop_{lang}.txt
// community/inventory_service/inventory_service_tags_{lang}.vdf
// community/stats_website/statsweb_{lang}.vdf (uses Go format placeholders)
// community/steam_input/steam_input_{lang}.vdf
// platform/servers/serverbrowser_{lang}.txt
// platform/vgui_{lang}.txt
// resource/basemodui_{lang}.txt
// resource/chat_{lang}.txt
// resource/closecaption_{lang}.txt
// resource/gameui_{lang}.txt
// resource/reactivedrop_{lang}.txt
// resource/valve_{lang}.txt
// rich_presence/563560_loc_{lang}.vdf (partially derived - #official_* strings are not translated separately)
//
// VDF KEYVALUES (each value is translated)
//
// addons/*/resource/*_{lang}.txt (excluding closecaption and reactivedrop)
// addons/*/scripts/*_{lang}.txt
// credits/*_{lang}.txt
// resource/mail/*_{lang}.txt
// resource/news/*_{lang}.txt
//
// STEAMWORKS TRANSLATION JSON (simple key-value JSON; "language" matches filename, "appid" is 563560, remaining keys have translatable string values)
//
// community/points_shop/app_items_563560_{lang}.json
// community/workshop/workshop_tags_{lang}.json
// store_page/appname_563560_{lang}.json (optional)
// store_page/appname_582400_{lang}.json (optional)
// store_page/appname_593000_{lang}.json (optional)
//
// STEAMWORKS STORE TRANSLATION JSON (as above, but no "appid" key and there's an "itemid" key set to 81731)
//
// store_page/storepage_81731_{lang}.json
//
// TITLE+DESC SIMPLE TEXT (3+ line plain text file: first line title, second line blank, remaining lines description)
//
// community/eula/eula_{lang}.txt
// community/workshop/mappingcontest{year}_{lang}.txt
// community/workshop/workshop_description_{lang}.txt
//
// SIMPLE TEXT (entire file is one string)
//
// store_page/content_warning_563560_{lang}.txt
//
// STEAMWORKS EVENT TRANSLATION XML (xpath /content/string[@id])
//
// release_notes/archive/{yyyy}/{yyyymmdd}_{lang}.xml (low priority)
// release_notes/{yyyymmdd}_{lang}.xml
//
// STEAMWORKS ITEM SCHEMA WITH AS:RD EXTENSIONS (see https://github.com/ReactiveDrop/reactivedrop_translations/blob/master/utils/config.go inventoryKeyPrefixes)
//
// community/inventory_service/item-schema-*.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal This issue needs discussion before it can be implemented.
Projects
None yet
Development

No branches or pull requests

2 participants