Skip to content

Commit

Permalink
ft4: Make a few strings translatable.
Browse files Browse the repository at this point in the history
Related to #11414
  • Loading branch information
StoyanDimitrov authored and kk7ds committed Aug 20, 2024
1 parent 63be12a commit 02af84f
Show file tree
Hide file tree
Showing 17 changed files with 548 additions and 303 deletions.
38 changes: 27 additions & 11 deletions chirp/drivers/ft4.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
RadioSettingValueList, RadioSettingValueString, RadioSettings

LOG = logging.getLogger(__name__)
COMM_DIRECTION_FROM = 0
COMM_DIRECTION_TO = 1


# Layout of Radio memory image.
Expand Down Expand Up @@ -301,7 +303,7 @@ def enter_clonemode(radio):
raise errors.RadioError("expected QX from radio.")


def startcomms(radio, way):
def startcomms(radio, direction):
"""
For either upload or download, put the radio into PROGRAM mode
and check the radio's ID. In this preliminary version of the driver,
Expand All @@ -310,8 +312,23 @@ def startcomms(radio, way):
send "PROGRAM" to command the radio into clone mode
read the initial string (version?)
"""

progress_messages = {
COMM_DIRECTION_FROM: _("Cloning from radio"),
COMM_DIRECTION_TO: _("Cloning to radio")
}

progressbar = chirp_common.Status()
progressbar.msg = "Cloning " + way + " radio"
if direction in progress_messages:
progressbar.msg = progress_messages[direction]
else:
LOG.debug(
f"direction parameter value is not recognised: {direction}"
)
raise errors.InvalidValueError(
f"Unexpected parameter received: {direction}"
)

progressbar.max = radio.numblocks
enter_clonemode(radio)
id_response = sendcmd(radio.pipe, b'\x02', None)
Expand Down Expand Up @@ -372,7 +389,7 @@ def do_download(radio):
"""
image = bytearray(radio.get_memsize())
pipe = radio.pipe # Get the serial port connection
progressbar = startcomms(radio, "from")
progressbar = startcomms(radio, COMM_DIRECTION_FROM)
for blocknum in range(radio.numblocks):
for i in range(0, 3):
if getblock(pipe, 16 * blocknum, image):
Expand Down Expand Up @@ -404,7 +421,7 @@ def do_upload(radio):
send "END"
"""
pipe = radio.pipe # Get the serial port connection
progressbar = startcomms(radio, "to")
progressbar = startcomms(radio, COMM_DIRECTION_TO)
data = get_mmap_data(radio)
for _i in range(1, radio.numblocks):
putblock(pipe, 16*_i, data[16*_i:16*(_i+1)])
Expand Down Expand Up @@ -698,16 +715,15 @@ def subtype(self, value):
@classmethod
def get_prompts(cls):
rp = chirp_common.RadioPrompts()
rp.experimental = (
'Tested and mostly works, but may give you issues\n'
'when using lesser common radio variants.\n'
'Proceed at your own risk, and let us know about issues!'
rp.experimental = _(
"Tested and mostly works, but may give you issues\n"
"when using lesser common radio variants.\n"
"Proceed at your own risk, and let us know about issues!"
)

rp.pre_download = "".join([
"1. Connect programming cable to MIC jack.\n",
rp.pre_download = _(
"1. Connect programming cable to MIC jack.\n"
"2. Press OK."
]
)
rp.pre_upload = rp.pre_download
return rp
Expand Down
78 changes: 41 additions & 37 deletions chirp/locale/bg_BG.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: CHIRP\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-05 16:29-0700\n"
"POT-Creation-Date: 2024-08-20 14:47-0700\n"
"PO-Revision-Date: 2024-07-05 10:00+0300\n"
"Last-Translator: Стоян <stoyanster от гмаил>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -83,6 +83,15 @@ msgstr "(няма)"
msgid "...and %i more"
msgstr "...и още %i"

# not existing
#: ../drivers/ft4.py:725
msgid ""
"1. Connect programming cable to MIC jack.\n"
"2. Press OK."
msgstr ""
"1. Включете кабела за програмиране в жака за микрофон.\n"
"2. Натиснете бутона „Добре“."

#: ../drivers/alinco.py:605 ../drivers/alinco.py:614
msgid ""
"1. Ensure your firmware version is 4_10 or higher\n"
Expand Down Expand Up @@ -615,7 +624,7 @@ msgid ""
"5. <b>After clicking OK</b>, press the [BAND] key.\n"
msgstr ""

#: ../drivers/uvk5.py:680
#: ../drivers/uvk5.py:658
msgid ""
"1. Turn radio on.\n"
"2. Connect cable to mic/spkr connector.\n"
Expand All @@ -626,7 +635,7 @@ msgid ""
"attached\n"
msgstr ""

#: ../drivers/uvk5.py:687
#: ../drivers/uvk5.py:665
msgid ""
"1. Turn radio on.\n"
"2. Connect cable to mic/spkr connector.\n"
Expand Down Expand Up @@ -792,11 +801,13 @@ msgstr "Записването завърши, проверка за параз
msgid "Cloning"
msgstr "Записване"

#: ../drivers/bj9900.py:133 ../drivers/ft450d.py:507 ../drivers/ft817.py:341
#: ../drivers/bj9900.py:133 ../drivers/ft450d.py:507 ../drivers/ft4.py:317
#: ../drivers/ft817.py:341
msgid "Cloning from radio"
msgstr "Зареждане от станция…"

#: ../drivers/bj9900.py:165 ../drivers/ft450d.py:536 ../drivers/ft817.py:379
#: ../drivers/bj9900.py:165 ../drivers/ft450d.py:536 ../drivers/ft4.py:318
#: ../drivers/ft817.py:379
msgid "Cloning to radio"
msgstr "Записване в станция"

Expand Down Expand Up @@ -880,7 +891,7 @@ msgid ""
"Polarity"
msgstr "Полярност на DTCS"

#: ../drivers/uvk5.py:908
#: ../drivers/uvk5.py:886
msgid "DTMF decode"
msgstr "Декодиране на DTMF"

Expand Down Expand Up @@ -971,7 +982,7 @@ msgstr "Инструкции за изтегляне"
msgid "Driver"
msgstr ""

#: ../drivers/uvk5.py:1326
#: ../drivers/uvk5.py:1304
msgid "Driver information"
msgstr ""

Expand Down Expand Up @@ -1091,7 +1102,7 @@ msgstr "Изнасяне в CSV…"
msgid "Extra"
msgstr "Допълнителни"

#: ../drivers/uvk5.py:1324
#: ../drivers/uvk5.py:1302
msgid "FM Radio"
msgstr "Радио ЧМ"

Expand Down Expand Up @@ -1553,11 +1564,11 @@ msgstr "Зареждане на настройки"
msgid "Login failed: Check your username and password"
msgstr ""

#: ../drivers/uvk5.py:1827
#: ../drivers/uvk5.py:1805
msgid "Logo string 1 (12 characters)"
msgstr "Логотип низ 1 (12 знака)"

#: ../drivers/uvk5.py:1834
#: ../drivers/uvk5.py:1812
msgid "Logo string 2 (12 characters)"
msgstr "Логотип низ 2 (12 знака)"

Expand Down Expand Up @@ -1993,11 +2004,11 @@ msgstr "Запазени настройки"
msgid "Scan control (skip, include, priority, etc)"
msgstr "Управление на сканиране (прескачане, включване, приоритет и т.н.)"

#: ../drivers/uvk5.py:922
#: ../drivers/uvk5.py:900
msgid "Scanlists"
msgstr "Списъци за сканиране"

#: ../drivers/ksun_m6.py:420 ../drivers/uvk5.py:918
#: ../drivers/ksun_m6.py:418 ../drivers/uvk5.py:896
msgid "Scrambler"
msgstr "Шифроване"

Expand Down Expand Up @@ -2114,6 +2125,19 @@ msgstr "Докладът за дефект е изпратен:"
msgid "TX-RX DTCS polarity (normal or reversed)"
msgstr "Полярност на DTCS при TX-RX (права или обратна)"

#: ../drivers/ft4.py:719
msgid ""
"Tested and mostly works, but may give you issues\n"
"when using lesser common radio variants.\n"
"Proceed at your own risk, and let us know about issues!"
msgstr ""
"Изпробвано и като цяло работи, но биха могли\n"
"да се появят проблеми при използване на\n"
"по-неразпространени варианти на станцията.\n"
"\n"
"Продължете на свой риск и ако се натъкнете\n"
"на проблеми ни уведомете!"

#: ../wxui/query_sources.py:480
msgid "The DMR-MARC Worldwide Network"
msgstr "Глобална мрежа на DMR-MARC"
Expand Down Expand Up @@ -2188,12 +2212,12 @@ msgid ""
"add support for the other revisions."
msgstr ""

#: ../drivers/radtel_rt490.py:1320 ../drivers/radtel_rt490.py:1322
#: ../drivers/radtel_rt490.py:1324
#: ../drivers/radtel_rt490.py:1324 ../drivers/radtel_rt490.py:1326
#: ../drivers/radtel_rt490.py:1328
msgid "This driver is in development and should be considered as experimental."
msgstr ""

#: ../drivers/uvk5.py:746
#: ../drivers/uvk5.py:724
msgid ""
"This image is missing firmware information. It may have been generated with "
"an old or modified version of CHIRP. It is advised that you download a fresh "
Expand Down Expand Up @@ -2222,7 +2246,7 @@ msgstr ""
msgid "This is an early stage beta driver - upload at your own risk\n"
msgstr ""

#: ../drivers/uvk5.py:672
#: ../drivers/uvk5.py:650
msgid ""
"This is an experimental driver for the Quansheng UV-K5. It may harm your "
"radio, or worse. Use at your own risk.\n"
Expand Down Expand Up @@ -2273,7 +2297,7 @@ msgid ""
"If you can get into it, please check the radio and cable.\n"
msgstr ""

#: ../drivers/uvk5.py:1912
#: ../drivers/uvk5.py:1890
msgid ""
"This should only be enabled if you are using modified firmware that supports "
"wider frequency coverage. Enabling this will cause CHIRP not to enforce OEM "
Expand Down Expand Up @@ -2572,14 +2596,6 @@ msgstr "{bank} е пълна"
#~ msgid "&Save"
#~ msgstr "&Запазване"

# not existing
#~ msgid ""
#~ "1. Connect programming cable to MIC jack.\n"
#~ "2. Press OK."
#~ msgstr ""
#~ "1. Включете кабела за програмиране в жака за микрофон.\n"
#~ "2. Натиснете бутона „Добре“."

#~ msgid "Bank 1"
#~ msgstr "Банка № 1"

Expand Down Expand Up @@ -2632,17 +2648,5 @@ msgstr "{bank} е пълна"
#~ msgid "Skip"
#~ msgstr "Пропускане"

#~ msgid ""
#~ "Tested and mostly works, but may give you issues\n"
#~ "when using lesser common radio variants.\n"
#~ "Proceed at your own risk, and let us know about issues!"
#~ msgstr ""
#~ "Изпробвано и като цяло работи, но биха могли\n"
#~ "да се появят проблеми при използване на\n"
#~ "по-неразпространени варианти на станцията.\n"
#~ "\n"
#~ "Продължете на свой риск и ако се натъкнете\n"
#~ "на проблеми ни уведомете!"

#~ msgid "Yes"
#~ msgstr "Да"
Loading

0 comments on commit 02af84f

Please sign in to comment.