Skip to content

Conversation

@timothyqiu
Copy link
Member

Closes #96105. The idea is salvaged from it.

This PR transfers format_number(), parse_number(), and precent_sign() from TextServer to TranslationServer.

  • The new methods don't have default parameters. The locale / language should be explicitly specified.
    • A "global" language does not make sense in most places since different translation domains can be showing different languages.
  • The methods on TextServer and TextServerExtension are deprecated, but still kept for compatibility.

Godot should look exactly the same after this change. Most work to explicitly specify the language has been done in #110378.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing text server specific to these methods, and TextServerAdvance implementation is not using ICU (since we are not compiling localization part of it, which is handling similar stuff), so TranslationServer is indeed a better place for these.

Copy link
Member

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this is going to be mildly annoying for localization, ironically. The descriptions between the old and new methods are so similar, if it weren't for the language-to-locale change, so this will inevitably create more translation strings.
Consider duplicating the description to the deprecated methods to ease the burden at least.

@timothyqiu
Copy link
Member Author

I added a description of the behavior when language is empty to the TextServer{,Extension} version's descriptions. This is the primary difference between the old and new versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants