-
Notifications
You must be signed in to change notification settings - Fork 82
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
Make the Humanise function better #2294
Comments
We've designed the translation to allow the translator some flexibilty in how the phrase is constructed, e.g. "circa {0} milione e mezzo", where One possibility is to offer translators an opportunity to assign a different translation where the leading number is '1' (e.g. "circa {0} milione e mezzo" where |
Well, it could be a step... with a way to "declare" the plurals in crowdin (something like I've built a "Italianise" script and replaced each Humanize call with it (with the problem of having to add a What if Humanise (and perhaps some other functions like "P"?) fires a "callback" script before returning his result? So, to recap this a bit: my new idea is
|
|
Oh you sweet summer child of a language where there is only one plural 😀 As one who speaks both Italian and Russian, let me introduce you to Slavic plurals, where the inflection depends upon the last word (not the last digit) of the number, e.g Russian (in Latin alphabet):
Oh, and the cardinal numbers are themselves nouns and must be declined. The word for 'about' is 'okolo' and takes genitive case, so for example 'dva' becomes 'dvukh': 'about two kilograms' is 'okolo dvukh kilogrammov'. Amazingly, Microsoft's default Russian TTS voice gets all the above right given just the left-hand side, so in the Russian translation the approach is to push as much work as possible to the TTS voice. I bring this up not to dismiss the idea but to illustrate how incredibly hard it is to generalise. I would certainly agree that |
EXACTLY!
Let me try with an example of what my envision is:
Humanise do his math and calls the "ReviewHumaniseOutput" script, which could access some variable like: The user do what they want and change the It seems to me the less "invasive", pretty useful and the most compatible solution. |
This is my current "Italianise" script.
The whole regex part returns what i would like to have already set by the new Humanise, before firing the "callback" script. HTH :) |
Hmm. Variables in Cottle are immutable, meaning that it would not be possible for the user to set In terms of complexity, you may be better off sticking with your Here's an example of how you could calculate some of the critical values for
From these calculated numbers, we know:
With 2 significant figures in the millions order and our third digit more than halfway to the next significant figure, we get a humanized value of "Over 54 and a half million". Hope that helps. |
Hmm... after going though the exercise above I think we might also be able to treat Humanise() as a special case of {F("Humanise")}, where we automatically set helpful values calculated from the original number and the translator does the rest using a It would be another major re-write / disruption for translators but should be possible. Much of the work that has gone into humanizing values via CrowdIn strings would become obsolete. @richardbuckle your thoughts? |
I think it would be important to get feedback from the other translation teams before embarking on such a radical overhaul. There are bound to be further language-specific issues that we are unaware of. |
I've sent a message to our proofreaders on CrowdIn to request additional feedback before we implement any changes. |
I have to say that it's not that too hard to make the adjustments in the scripts to get the proper pronunciation in Portuguese. But I am not against such changes. |
I'm Spanish and in my case I had to write my own "Humaniza" function. For example: And that is not a regular law. I mean, is difficult to code not counting all the exceptions, even harder if you have to adapt the code to other languages. Also, the main issue I encountered, some voices don't read them as it should (the gender doesn't match for example). So I coded inside the new humaniza function my own way to spell the numbers. It converts the numbers to words and uses a flag for gender. This way, the voice will read it as I want. The tricky part is the invocation, because You can't give parameters to a script directly. I placed this at the beginning of each script that needs it:
And invoke it just as normal function: Three state variables are used: "1500000" going through my script return "un millón y medio" while humanise() returns "1000000 y medio". So my final words are that the thought about making the internal humanise() function some kind of a "function editable by the user via script" is a nice idea. |
I think that a couple of changes in the Humanise function would help a lot non english users:
The first one seems an easy task (if i'm not missing how other voices works), dunno about the second.
The text was updated successfully, but these errors were encountered: