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

Fix #22072: Localisation: Separate objective date string from staff tenure date string #22074

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

mrmagic2020
Copy link
Contributor

Attempts to fix #22072.

I was able to build the game locally and have the issue addressed. I tested the changes by setting
STR_2736 :{MONTH}, Year {COMMA16} (used for label-value pairs), and
STR_6640 :{MONTH}, Year {COMMA16} (used in sentences)
to different values. I then replaced {MONTHYEAR} to {MONTHYEAR_SENTENCE} in STR_2836 and STR_2837, and the change can be observed in-game.

image
image

As I am new to contributing to this project, please review carefully for any mistakes I might have made. Thanks!

@mrmagic2020
Copy link
Contributor Author

I noticed that formatting tests are failing because I added a new enum member for FormatToken, which caused a shift of the enum values of succeeding members. Should I modify the tests as well?

@AaronVanGeffen
Copy link
Member

Could you elaborate why you chose to introduce a new format token? It seems to me the only difference is an added period at the end, which could just be moved to the format string instead.

@mrmagic2020
Copy link
Contributor Author

Could you elaborate why you chose to introduce a new format token? It seems to me the only difference is an added period at the end, which could just be moved to the format string instead.

Because according to #22072, we need to differentiate M/Y tokens in sentences and a label-value pair for languages that require this feature. So I thought we would need different tokens for each case.

data/language/en-GB.txt Outdated Show resolved Hide resolved
src/openrct2/localisation/Formatting.cpp Outdated Show resolved Hide resolved
@groenroos
Copy link

Thanks, this looks like it would address #22072! What needs to still happen before this can be merged? 🙂

}
break;
case FormatToken::MonthYearSentence:
if constexpr (std::is_integral<T>())
Copy link
Member

Choose a reason for hiding this comment

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

(Note to self:) This check shouldn’t be necessary. Also fold in with previous condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localisation: Separate objective date string from staff tenure date string
5 participants