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

Strip space after color code in locale files #1044

Closed
tastybento opened this issue Nov 28, 2019 · 0 comments
Closed

Strip space after color code in locale files #1044

tastybento opened this issue Nov 28, 2019 · 0 comments
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Enhancement Improvement or modification which is usually a new feature.

Comments

@tastybento
Copy link
Member

Description

Is your feature request related to a problem?

GitLocalize machine translation gets confused with color codes. For example "&cOnly players can do that!" will make it try to translate the word "conly", which is not an English word, so it usually is left untranslated. This then affects the whole sentence. Although this is not an issue for manual translation, one of the benefits of GitLocalize is the fast machine translation.

Describe the solution you'd like us to implement.

Strip one space after a color code when reading the locale files. So, the translation file will be:
"&c Only players can do that!"
and the User translation class will strip the space after the color code automatically so it will become "&cOnly players can do that!" This is to avoid formatting issues.

Describe alternatives you've considered.

Using other characters, like hyphens. e.g. "&6-" or &c-"

Additional context

@tastybento tastybento added the Type: Enhancement Improvement or modification which is usually a new feature. label Nov 28, 2019
@tastybento tastybento self-assigned this Nov 28, 2019
@tastybento tastybento added this to the 1.9.0 - SpigotMC release! milestone Nov 28, 2019
@tastybento tastybento added the Status: In progress Working on the issue. label Nov 28, 2019
tastybento added a commit that referenced this issue Nov 28, 2019
Space will be stripped if it exists. This makes GitLocalize able to
machine translate much better.

Changes to the English locale file was made. Other languages do not have
to add spaces. Note that adding or removing spaces from files is easy
with regex.

#1044
tastybento added a commit that referenced this issue Dec 1, 2019
Space will be stripped if it exists. This makes GitLocalize able to
machine translate much better.

Changes to the English locale file was made. Other languages do not have
to add spaces. Note that adding or removing spaces from files is easy
with regex.

#1044
@Poslovitch Poslovitch added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: In progress Working on the issue. labels Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Enhancement Improvement or modification which is usually a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants