Skip to content

Declare textdomain of .po files inside the header #17021

@Zughy

Description

@Zughy

Problem

Right now textdomain is extracted in two ways:

  • title of the file
  • msgctxt field above a string

However, there are cases where more locale files are needed and spamming msgctxt is not the cleanest implementation. Regarding the former: a game with both the mod/locale folder and a world/locale folder (for custom data, e.g. name of NPCs, dialogues, places). We can't have two files with the same name, so right now we can only spam msgctxt in the world folder. strings This is suboptimal and, most importantly, fills Weblate with "Context of this string: your_mod_name" (since it takes the msgctxt field)

Solutions

Use the Project-Id-Version header string to pass the textdomain. It can grep everything before the first -, so people can still use Id and version if they want to (e.g. my_cool_mod-3-5.1).

Custom msgctxt fields can still override the single string textdomain - even if I personally don't find them very useful

Alternatives

No idea

Additional context

This was discussed with @y5nw , so tagging them

Metadata

Metadata

Assignees

No one assigned

    Labels

    @ TranslationFeature requestIssues that request the addition or enhancement of a feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions