-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ukrainian language support #19
Conversation
Hey, I've seen you do a lot of work in here, thanks a lot! Sorry for the delay -- I was a bit inactive the last few days. I will take a look and answer everything you've been sending tomorrow. Once again, sorry if I wasn't active before, but I will answer everything! Thanks again. |
It's ok, take your time. Just merge it so we can move on. |
Hey, sorry for the extended delay, I did an initial review on your commits, can you take a look at them? Thanks a lot for the contribution, it means a lot :) |
Ok, I've closed the most issues. Still, several rustfmt::skip remain; and one more thing: I've added prefer() arguments description, but I think formatting is poor, and probably it should be split moved to specific languages. Any ideas? |
src/num2words.rs
Outdated
/// | ||
/// Gender: **masculine/m/чоловічий/чол/ч**, feminine/f/жіночий/жін/ж, neuter/n/середній/сер/с | ||
/// | ||
/// Declenation: **nominative/nom/називний/н**, genitive/gen/родовий/р, dative/dat/давальний/д, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declenation => Declination
const ORDINAL_FLEXIONS_PLURAL_SHORT: [&str; 6] = [ | ||
"і", "х", "м", "х", "ми", "х", | ||
]; | ||
const ORDINAL_FLEXIONS_PLURAL_SHORT: [&str; 6] = ["і", "х", "м", "х", "ми", "х"]; | ||
|
||
#[rustfmt::skip] | ||
const NOUN_2ST_GROUP_HARD_DECLENSIONS: [[&str; 6]; 2] = [ //долар |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using a lot of references to DECLENSIONS
here, instead of DECLINATION
. For consistency, I believe it would be better to have them be the same everywhere.
This can be easily modified using a sed command: find src -type f -exec sed -i 's/DECLENSIONS/DECLINATIONS/g' {} +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I often tell myself not to work when it's late… but that's the only way to work on side projects.
src/lang/uk.rs
Outdated
NOUN_2ST_GROUP_HARD_DECLENSIONS[number_idx][declination_idx] | ||
), | ||
Currency::RUB => | ||
//format!("рубл{}", NOUN_1ST_GROUP_MASCULINE_SOFT_DECLENSIONS[number_idx][declination_idx]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are still a lot of previously-used comments that are removed from usage, is this supposed to act like documentation?
Currency::RUB => | ||
//format!("рубл{}", NOUN_1ST_GROUP_MASCULINE_SOFT_DECLENSIONS[number_idx][declination_idx]), | ||
{ | ||
String::from("руській воєнний корабль іді нахуй") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or is this just a little troll with that haha :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just... won't fix. Maybe someday someone will be able to do it. But not me, not now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll keep it for now haha! I probably won't keep it forever though, as I want my lib to be usable in the most cases possible (even though in theory the license added a "no warranty" section). I'll keep it for a few releases and will fix that later.
Thanks though for putting the actual thing in comments!
Currency::ZAR => format!( | ||
"ранд{}", | ||
NOUN_2ST_GROUP_HARD_DECLENSIONS[number_idx][declination_idx] | ||
), | ||
//_ => currency.default_string(self.number == GrammaticalNumber::Plural), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related with #21, this is supposed to be my way of doing, by putting a "default value" through a default_string
function. using non_exhaustive is better that this, but my initial plan was to keep this uncommented in case someone in the future adds a currency.
I've also added a bunch of currencies in the past just to make sure adding new currencies isn't supposed to happen often
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think currencies are updating more quickly.
In Ukraine, we had 3 currencies over the past 35 years (Soviet ruble, Ukrainian karbovanets, Ukrainian hryvnia), and expect Euro to be here in 10 years. There are some 180 currencies in the world; even if the average time of life of the currency is 200 year (clearly an overestimation), it still means one currency is changed in a year and 40 days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, I think it's a good idea to leave it there - when the new currency will be added, this will at least help to fix the build for testing other languages.
Currency::RUB => | ||
//format!("копійк{}", NOUN_1ST_GROUP_FEMININE_HARD_DECLENSIONS[number_idx][declination_idx]), | ||
{ | ||
String::from("руській воєнний корабль іді нахуй") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm torn between keeping this or putting the original format!
just to make sure the lib is usable haha
Thank you for your hard work, it's very much appreciated! I can be a little bit picky on my code review, it's just that I want it to be perfect, but your work is very well done, thank you again! |
Hey, one small thing: there also needs to be two lines added in |
Added to Supported languages. |
README.md
Outdated
| Flag | Code | ISO 639-1 | Language | 42 | | ||
| ---- | ----------------- | --------- | ---------- | --------- | | ||
| 🇺🇸🇬🇧 | `Lang::English` | `en` | English | forty-two | | ||
| 🇺🇦 | `Lang::Ukrainian` | `ua` | Ukrainian | сорок два | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISO 639-1 code of Ukrainian is uk
, not ua
:)
src/lib.rs
Outdated
* | Flag | Code | ISO 639-1 | Language | 42 | | ||
* | ---- | ----------------- | --------- | ---------- | --------- | | ||
* | 🇺🇸🇬🇧 | `Lang::English` | `en` | English | forty-two | | ||
* | 🇺🇦 | `Lang::Ukrainian` | `ua` | Ukrainian | сорок два | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Pavlo, you're working late once again... |
Done |
Thanks a lot Pavlo! that's very appreciated :) |
Completed all functions for Ukrainian (currency fractions are still a bit of mess, but it looks like there are like that in the original too)