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

Format uk #50

Merged
merged 25 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
23df4ab
initial translation and parse.py reform
NeonMariia Aug 22, 2022
daf1052
adding plurals dict
NeonMariia Oct 10, 2022
1d9af86
plurals problem fixes, cases flections
NeonMariia Oct 11, 2022
95111d7
fixing fractions cases changes
NeonMariia Oct 19, 2022
dd085e0
format uk + format tests, parse datetime in separate file
NeonMariia Dec 5, 2022
eb64199
Merge branch 'OpenVoiceOS:dev' into uk_support
NeonMariia Dec 5, 2022
1ef4247
adding new text files
NeonMariia Dec 5, 2022
7808d90
yes_no tests
NeonMariia Dec 8, 2022
4d6b5eb
format changes
NeonMariia Dec 27, 2022
8b53f7a
Merge branch 'OpenVoiceOS:dev' into uk_support
NeonMariia Dec 27, 2022
5f94b08
cleaning file
NeonMariia Dec 27, 2022
9226f30
format translation
NeonMariia Dec 28, 2022
8ddc82c
datetime fixes
NeonMariia Jan 11, 2023
b9273ad
class tests passing
NeonMariia Jan 12, 2023
c2659e0
format tests fixes
NeonMariia Jan 12, 2023
8195d41
format tests fixes
NeonMariia Jan 12, 2023
4afb6ff
fix_uk
NeonDmitry Apr 4, 2023
674573a
Merge pull request #1 from NeonDmitry/fixes_format_uk
NeonMariia Apr 5, 2023
b55b86b
couple changes
NeonDmitry Apr 6, 2023
8c76088
Merge pull request #2 from NeonDmitry/fixes_format_uk
NeonMariia Apr 6, 2023
fd42f1d
Remove leftover `print` lines
NeonDaniel Apr 6, 2023
2d740e8
Delete _trial_marker
emphasize Apr 6, 2023
10ce49a
add 'та' to 'yes' words
ChanceNCounter Apr 6, 2023
de42a36
rm stray local test artifacts
ChanceNCounter Apr 6, 2023
c34be3e
rm spun-off test files from parse_uk implementation
ChanceNCounter Apr 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lingua_franca/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,20 @@ def _format_string(self, number, format_section, lang):

def _decade_format(self, number, number_tuple, lang):
s = self._format_string(number % 100, 'decade_format', lang)
decade = s.format(x=number_tuple.x, xx=number_tuple.xx,
x0=number_tuple.x0, x_in_x0=number_tuple.x_in_x0,
number=str(number % 100))
return s.format(x=number_tuple.x, xx=number_tuple.xx,
x0=number_tuple.x0, x_in_x0=number_tuple.x_in_x0,
number=str(number % 100))

def _number_format_hundreds(self, number, number_tuple, lang,
formatted_decade):
s = self._format_string(number % 1000, 'hundreds_format', lang)
hundreds = s.format(xxx=number_tuple.xxx, x00=number_tuple.x00,
x_in_x00=number_tuple.x_in_x00,
formatted_decade=formatted_decade,
number=str(number % 1000))
return s.format(xxx=number_tuple.xxx, x00=number_tuple.x00,
x_in_x00=number_tuple.x_in_x00,
formatted_decade=formatted_decade,
Expand Down
7 changes: 4 additions & 3 deletions lingua_franca/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@


_SUPPORTED_LANGUAGES = ("az", "ca", "cs", "da", "de", "en", "es", "fr", "hu",
"it", "nl", "pl", "pt", "ru", "sl", "sv", "fa", "eu")
"it", "nl", "pl", "pt", "ru", "sl", "sv", "fa", "eu", "uk")

_SUPPORTED_FULL_LOCALIZATIONS = ("az-az", "ca-es", "cs-cz", "da-dk", "de-de",
"en-au", "en-us", "es-es", "fr-fr",
"hu-hu", "it-it", "nl-nl", "pl-pl",
"fa-ir", "pt-pt", "ru-ru", "sl-si",
"sv-se", "tr-tr", "eu-eu")
"sv-se", "tr-tr", "eu-eu", "uk-uk")

_DEFAULT_FULL_LANG_CODES = {'az': 'az-az',
'ca': 'ca-es',
Expand All @@ -36,7 +36,8 @@
'ru': 'ru-ru',
'sl': 'sl-si',
'sv': 'sv-se',
'tr': 'tr-tr'}
'tr': 'tr-tr',
'uk': 'uk-uk'}

__default_lang = None
__active_lang_code = None
Expand Down
6 changes: 6 additions & 0 deletions lingua_franca/lang/common_data_ru.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@
'минута': 'minutes',
'минуты': 'minutes',
'минут': 'minutes',
'година': 'hours',
'годин': 'hours',
'години': 'hours',
'годиною': 'hours',
'годинами': 'hours',
'годині': 'hours',
'час': 'hours',
'часа': 'hours',
'часов': 'hours',
Expand Down
Loading