Skip to content

Commit

Permalink
Merge pull request #113 from rafaljanicki/master
Browse files Browse the repository at this point in the history
Initial polish support
  • Loading branch information
ChanceNCounter authored Nov 2, 2020
2 parents 78b8ede + da873ac commit 7ffb650
Show file tree
Hide file tree
Showing 18 changed files with 3,037 additions and 7 deletions.
7 changes: 5 additions & 2 deletions lingua_franca/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
populate_localized_function_dict, get_active_langs, \
get_full_lang_code, get_default_lang, get_default_loc, \
is_supported_full_lang, _raise_unsupported_language, \
UnsupportedLanguageError, NoneLangWarning, InvalidLangWarning
UnsupportedLanguageError, NoneLangWarning, InvalidLangWarning, \
FunctionNotLocalizedError


_REGISTERED_FUNCTIONS = ("nice_number",
"nice_time",
"pronounce_number",
"nice_response")
"nice_response",
"nice_duration")

populate_localized_function_dict("format", langs=get_active_langs())

Expand Down Expand Up @@ -367,6 +369,7 @@ def nice_year(dt, lang=None, bc=False):
return date_time_format.year_format(dt, full_code, bc)


@localized_function(run_own_code_on=[FunctionNotLocalizedError])
def nice_duration(duration, lang=None, speech=True):
""" Convert duration in seconds to a nice spoken timespan
Expand Down
5 changes: 3 additions & 2 deletions lingua_franca/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from warnings import warn

_SUPPORTED_LANGUAGES = ("cs", "da", "de", "en", "es", "fr", "hu",
"it", "nl", "pt", "sv")
"it", "nl", "pl", "pt", "sv")

_SUPPORTED_FULL_LOCALIZATIONS = ("cs-cz", "da-dk", "de-de", "en-au", "en-us",
"es-es", "fr-fr", "hu-hu", "it-it", "nl-nl",
"pt-pt", "ru-ru", "sv-se", "tr-tr")
"pl-pl", "pt-pt", "ru-ru", "sv-se", "tr-tr")

_DEFAULT_FULL_LANG_CODES = {'cs': 'cs-cz',
'da': 'da-dk',
Expand All @@ -21,6 +21,7 @@
'hu': 'hu-hu',
'it': 'it-it',
'nl': 'nl-nl',
'pl': 'pl-pl',
'pt': 'pt-pt',
'ru': 'ru-ru',
'sv': 'sv-se',
Expand Down
Loading

0 comments on commit 7ffb650

Please sign in to comment.