-
-
Notifications
You must be signed in to change notification settings - Fork 124
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 for issue 348 #648
base: 1.19.x
Are you sure you want to change the base?
Fix for issue 348 #648
Conversation
Added special tens category for values less than 0 Commented on units distinction. Made it so that edition values below 0 return Writer's Edition.
Let me know whether I understood this implementation correctly, please.
Assuming the above interpretation corresponds to your intention, this implementation looks good in my opinion. Having rebased it onto the 1.20.x branch locally, I gave it a test run with a couple different book version numbers and it seemed to work as I described above. There are just two little things left to do:
(I don't know if it makes sense to fix the now incorrect values of the |
Yes, your understanding of my implementation is correct. As for the other languages, I suggest that you put in "Writer's Edition" as it would currently appear and then let whoever takes care of that language's translation fix it if needed. Of course, if you know any of those langauges, then it would be better if you fixed it yourself. Is there anything else that I need to do or can you take care of those two remaining things you mentioned? I'd rather avoid touching any more code since I know next to nothing about Java and even less about GitHub workflows, tests and the like. |
This is meant to fix issue #348. Please revise this and make sure it actually works, because I have no idea how to do that.
However, here how it's supposed to work.
In all translation files, there should be the following strings:
These strings define the behavior for certain categories of numbers:
.uu
string, for numbers between 1 and 9 inclusive..00
string, for numbers > 10 whose tens digit and hundreds digit are 0..10
to.90
, for numbers whose tens digit is 1 to 9..100
string, for numbers whose tens digit is 0 and whose hundreds digit is not 0.These strings should be translated as one of the following:
"%1$s<suffix>"
: All numbers in that category will use the suffix. (Of course, it could also be a prefix if you write it before the variable. Same goes in all other cases.)"%2$s"
: All numbers in that category will use a generic suffix based on the number's units digit. These can be defined by translating the strings"patchouli.gui.lexicon.edition_str.ord.0"
through"patchouli.gui.lexicon.edition_str.ord.9"
as"%1$s<suffix>"
."%3$s"
: All numbers in that category will use a suffix based on the number's units AND tens digits. These can be defined by translating the strings"patchouli.gui.lexicon.edition_str.ord.<tens>.0"
through"patchouli.gui.lexicon.edition_str.ord.<tens>.9"
, where<tens>
should be replaced with uu, 10, 20, ecc… depending on the category of numbers that it applies to. Those strings can be translated as"%1$s<suffix>"
(if you want to use a special suffix) or as"%2$s"
(if you want to use the units suffix, i.e."patchouli.gui.lexicon.edition_str.ord.<units>"
).Since negative ordinal numbers don't exist, I've also made it so that using negative numbers returns the "Writer's Edition".
Also regarding the Writer's Edition, since in some languages "Writer's" might be positioned differently from the ordinal, "Writer's Edition" is now its own string, completely independent from "%s Edition" which is only for ordinals.