Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcpantoja committed Oct 16, 2023
1 parent 20bea35 commit 1deabeb
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 105 deletions.
7 changes: 4 additions & 3 deletions addon/globalPlugins/num2word.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def convert_date(date, format, language="en"):
return f"{day} de {months[mont-1][1]}"
elif format == 2:
return f"{months[mont-1][1]} {day}"
raise Exception("invalid date format")
# Translators: Message when the date is not valid.
raise Exception(_("invalid date format"))

def convert_hour(hour):
hours = int(hour.split(':')[0])
Expand All @@ -89,7 +90,8 @@ def convert_hour(hour):
seconds = int(hour.split(':')[2])
# checks:
if hours > 23 or minutes > 59 or seconds > 59:
raise Exception("Invalid hour!")
# Translators: Message when it is an invalid hour. I mean, out of range to 23:59:59
raise Exception(_("Invalid hour!"))
if hours == 1:
# Translators: Conversion message if is an one hour.
hour_str = _("one hour")
Expand Down Expand Up @@ -389,7 +391,6 @@ def onConvert(self, event):
wx.ICON_ERROR
)
else:
print(self.currency)
words = convert_num_to_words(
utterance=to_convert,
ordinal=self.use_ordinal_only,
Expand Down
82 changes: 47 additions & 35 deletions addon/locale/es/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ msgid ""
msgstr ""
"Project-Id-Version: num2words 0.4\n"
"Report-Msgid-Bugs-To: '[email protected]'\n"
"POT-Creation-Date: 2023-07-25 19:25-0500\n"
"PO-Revision-Date: 2023-04-05 06:28-0500\n"
"POT-Creation-Date: 2023-10-16 15:34-0500\n"
"PO-Revision-Date: 2023-10-16 15:40-0500\n"
"Last-Translator: Mateo Cedillo <[email protected]>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.3.2\n"

#: addon\globalPlugins\num2word.py:38
msgid "January"
Expand Down Expand Up @@ -66,28 +66,38 @@ msgstr "Noviembre"
msgid "December"
msgstr "Diciembre"

#. Translators: Message when the date is not valid.
#: addon\globalPlugins\num2word.py:83
msgid "invalid date format"
msgstr "Este no es un formato de hora válido"

#. Translators: Message when it is an invalid hour. I mean, out of range to 23:59:59
#: addon\globalPlugins\num2word.py:94
msgid "Invalid hour!"
msgstr "¡Hora inválida!"

#. Translators: Conversion message if is an one hour.
#: addon\globalPlugins\num2word.py:95
#: addon\globalPlugins\num2word.py:97
msgid "one hour"
msgstr "una hora"

#. Translators: Conversion message if is an one minute.
#: addon\globalPlugins\num2word.py:103
#: addon\globalPlugins\num2word.py:105
msgid "one minute"
msgstr "un minuto"

#. Translators: Conversion message if is an one second.
#: addon\globalPlugins\num2word.py:111
#: addon\globalPlugins\num2word.py:113
msgid "one second"
msgstr "un segundo"

#. Translators: Error message when the number is too big.
#: addon\globalPlugins\num2word.py:129
#: addon\globalPlugins\num2word.py:131
msgid "The number is too big! twenty seven numbers maximum"
msgstr "¡El número es demasiado grande! veintisiete números como máximo"

#. Translators: Error message if the language is not supported by num2words.
#: addon\globalPlugins\num2word.py:145
#: addon\globalPlugins\num2word.py:147
msgid ""
"The language set in the speech synthesis is not supported by the num2words "
"library. If you want to suggest or add this language, you can do it through "
Expand All @@ -99,125 +109,127 @@ msgstr ""
"com/savoirfairelinux/num2words"

#. Translators: Title of the error message.
#: addon\globalPlugins\num2word.py:147 addon\globalPlugins\num2word.py:328
#: addon\globalPlugins\num2word.py:149 addon\globalPlugins\num2word.py:330
msgid "Error"
msgstr "Error"

#. Translators: Name of the conversion dialog.
#: addon\globalPlugins\num2word.py:208
#: addon\globalPlugins\num2word.py:210
msgid "Convert number to words"
msgstr "Convertir número a palabras"

#. Translators: message to inform the user that there is no type of currency to convert with this language.
#: addon\globalPlugins\num2word.py:220
#: addon\globalPlugins\num2word.py:222
msgid "There are no currencies to convert for this language. Using default."
msgstr "No hay monedas a convertir para este idioma. Usando el predeterminado."

#. Translators: Label for the input box for the conversion.
#: addon\globalPlugins\num2word.py:227
#: addon\globalPlugins\num2word.py:229
msgid "Write something here, example: 3 free throws"
msgstr "Escribe algo aquí, por ejemplo: 3 tiros libres"

#. Translators: Label for the conversion button.
#: addon\globalPlugins\num2word.py:234
#: addon\globalPlugins\num2word.py:236
msgid "Convert"
msgstr "Convertir"

#. Translators: Label for the button to cancel the conversion.
#: addon\globalPlugins\num2word.py:239
#: addon\globalPlugins\num2word.py:241
msgid "Cancel"
msgstr "Cancelar"

#. Translators: label for the checkbox to convert to ordinals.
#: addon\globalPlugins\num2word.py:244
#: addon\globalPlugins\num2word.py:246
msgid "Ordinal mode"
msgstr "Modo ordinal"

#. Translators: label for the combo box to choose the conversion mode.
#: addon\globalPlugins\num2word.py:249
#: addon\globalPlugins\num2word.py:251
msgid "Choose conversion &mode:"
msgstr "Selecciona el &modo de conversión:"

#: addon\globalPlugins\num2word.py:255
#: addon\globalPlugins\num2word.py:257
msgid "None"
msgstr "Ninguno"

#: addon\globalPlugins\num2word.py:256
#: addon\globalPlugins\num2word.py:258
msgid "cardinal"
msgstr "cardenal"

#: addon\globalPlugins\num2word.py:257
#: addon\globalPlugins\num2word.py:259
msgid "Ordinal"
msgstr "Ordinal"

#: addon\globalPlugins\num2word.py:258
#: addon\globalPlugins\num2word.py:260
msgid "Ordinal number"
msgstr "Número ordinal"

#: addon\globalPlugins\num2word.py:259
#: addon\globalPlugins\num2word.py:261
msgid "Date"
msgstr "FECHA"

#: addon\globalPlugins\num2word.py:260
#: addon\globalPlugins\num2word.py:262
msgid "Hour"
msgstr "Hora"

#: addon\globalPlugins\num2word.py:261
#: addon\globalPlugins\num2word.py:263
msgid "Year"
msgstr "Año"

#: addon\globalPlugins\num2word.py:262
#: addon\globalPlugins\num2word.py:264
msgid "Currency"
msgstr "Moneda"

#. Translators: label for the currency selection combo box.
#: addon\globalPlugins\num2word.py:268
#: addon\globalPlugins\num2word.py:270
msgid "Select the currency to convert:"
msgstr "Selecciona la moneda a convertir:"

#. Translators: Error message when there is nothing to convert.
#: addon\globalPlugins\num2word.py:326
#: addon\globalPlugins\num2word.py:328
#, fuzzy
msgid "there's nothing to convert"
msgstr "No hay nada que convertir"

#. Translators: Title of the error message.
#: addon\globalPlugins\num2word.py:362 addon\globalPlugins\num2word.py:380
#: addon\globalPlugins\num2word.py:388
#: addon\globalPlugins\num2word.py:364 addon\globalPlugins\num2word.py:382
#: addon\globalPlugins\num2word.py:390
msgid "Conversion error"
msgstr "Error de conversión"

#. Translators: Error message when a valid time is not given.
#: addon\globalPlugins\num2word.py:386
#: addon\globalPlugins\num2word.py:388
msgid "This is not a valid hour format"
msgstr "Este no es un formato de hora válido"

#. Translators: title of the conversion results dialog.
#: addon\globalPlugins\num2word.py:404
#: addon\globalPlugins\num2word.py:405
msgid "Conversion results"
msgstr "Resultados de conversión"

#. Translators: Add-on category name.
#: addon\globalPlugins\num2word.py:419
#: addon\globalPlugins\num2word.py:420
msgid "Number to words"
msgstr "Número a palabras"

#. Translators: Description of the conversion of numbers to words in real time mode for input help.
#: addon\globalPlugins\num2word.py:440
#: addon\globalPlugins\num2word.py:441
msgid "Switch reading from numbers to words."
msgstr "Alternar la lectura de números a palabras."

#. Translators: message announced when realtime mode is enabled.
#: addon\globalPlugins\num2word.py:448
#: addon\globalPlugins\num2word.py:449
#, fuzzy
msgid "Num2words enabled."
msgstr "Números a palabras activado."

#. Translators: message announced when realtime mode is disabled.
#: addon\globalPlugins\num2word.py:452
#: addon\globalPlugins\num2word.py:453
msgid "Num2words disabled."
msgstr "Números a palabras desactivado."

#. Translators: Description of the manual conversion dialog for input help.
#: addon\globalPlugins\num2word.py:457
#: addon\globalPlugins\num2word.py:458
msgid "Opens a dialog to convert number to words manually"
msgstr "Abre un diálogo para convertir números a palabras de forma manual"

Expand Down
Loading

0 comments on commit 1deabeb

Please sign in to comment.