Skip to content

Commit

Permalink
Fix: locale-gen script
Browse files Browse the repository at this point in the history
Add: kz_KZ language
  • Loading branch information
badcast committed Nov 28, 2023
1 parent 3f95b5b commit 9c477b2
Show file tree
Hide file tree
Showing 8 changed files with 347 additions and 44 deletions.
5 changes: 0 additions & 5 deletions localization/locale-gen-machine.sh

This file was deleted.

28 changes: 21 additions & 7 deletions localization/locale-gen.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
#!/bin/sh

find ../ ../src -type f -name "*.c" -o -name "*.h" | xargs xgettext -j --msgid-bugs-address="lmecomposer@gmail.com" --copyright-holder="badcast" --keyword=gettext --keyword=_ -o messages.pot --from-code=UTF-8 -d dragon-tea
function gen_locales()
{
# Generate language (example, en_US, ru_RU)

for l in $@; do
echo Generating locale for $l
if [ ! -e "translates/$l.po" ]; then
msginit --locale=$l.UTF-8 --input=messages.pot --output=translates/$l.po
else
msgmerge --update translates/$l.po messages.pot
fi

# Gen machine (.mo)

if [ ! -e "translates/ru_RU.po" ]; then
msginit --locale=ru_RU.UTF-8 --input=messages.pot --output=translates/ru_RU.po
else
msgmerge --update translates/ru_RU.po messages.pot
fi
mkdir -p ./locale/$l/LC_MESSAGES

msgfmt translates/$l.po -o ./locale/$l/LC_MESSAGES/dragon-tea.mo

done
}

find ../ ../src -type f -name "*.c" -o -name "*.h" | xargs xgettext -j --msgid-bugs-address="lmecomposer@gmail.com" --copyright-holder="badcast" --keyword=gettext --keyword=_ -o messages.pot --from-code=UTF-8 -d dragon-tea

sh ./locale-gen-machine.sh
gen_locales ru_RU kz_KZ
Binary file not shown.
Binary file modified localization/locale/ru_RU/LC_MESSAGES/dragon-tea.mo
Binary file not shown.
42 changes: 31 additions & 11 deletions localization/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: lmecomposer@gmail.com\n"
"POT-Creation-Date: 2023-11-11 00:44+0600\n"
"POT-Creation-Date: 2023-11-28 12:54+0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -17,11 +17,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: ../src/tea.c:270 ../src/tea.c:273
#: ../src/tea.c:270 ../src/tea.c:273 ../src/tea.c:308
msgid "Error"
msgstr ""

#: ../src/core/ui_about.c:9 ../src/core/ui.c:7
#: ../src/core/ui_about.c:9 ../src/core/ui.c:7 ../src/core/ui.c:21
msgid "Dragon Tea"
msgstr ""

Expand Down Expand Up @@ -108,70 +108,78 @@ msgstr ""
msgid "Enter nickname..."
msgstr ""

#: ../src/core/ui.c:20
#: ../src/core/ui.c:20 ../src/core/ui.c:34
msgid "Authentication"
msgstr ""

#: ../src/core/ui.c:22
#: ../src/core/ui.c:22 ../src/core/ui.c:36
msgid "Dragon chat"
msgstr ""

#: ../src/core/ui.c:24
#: ../src/core/ui.c:24 ../src/core/ui.c:38
msgid "Configuration"
msgstr ""

#: ../src/core/ui.c:26
#: ../src/core/ui.c:26 ../src/core/ui.c:40
msgid "About"
msgstr ""

#: ../src/core/ui.c:72 ../src/core/ui.c:83
#: ../src/core/ui.c:72 ../src/core/ui.c:83 ../src/core/ui.c:97
msgid "You state is offline"
msgstr ""

#: ../src/core/ui_callbacks.c:81
#: ../src/core/ui_callbacks.c:81 ../src/core/ui_callbacks.c:85
#, c-format
msgid "The message has been sent. Time of sending %s, received %s"
msgstr ""

#: ../src/core/ui_callbacks.c:98
#: ../src/core/ui_callbacks.c:98 ../src/core/ui_callbacks.c:102
msgid "Error send."
msgstr ""

#: ../src/core/ui_callbacks.c:118
#: ../src/core/ui_callbacks.c:118 ../src/core/ui_callbacks.c:122
#, c-format
msgid "Synchronization of %ld messages"
msgstr ""

#: ../src/core/ui_callbacks.c:136 ../src/core/ui_callbacks.c:137
#: ../src/core/ui_callbacks.c:141
msgid "Your network has been restored. "
msgstr ""

#: ../src/core/ui_callbacks.c:140 ../src/core/ui_callbacks.c:141
#: ../src/core/ui_callbacks.c:145
msgid "You're online."
msgstr ""

#: ../src/core/ui_callbacks.c:172 ../src/core/ui_callbacks.c:173
#: ../src/core/ui_callbacks.c:177
msgid "Your account has been deleted."
msgstr ""

#: ../src/core/ui_callbacks.c:180 ../src/core/ui_callbacks.c:181
#: ../src/core/ui_callbacks.c:185
#, c-format
msgid "Network error. Your connection has been reset (%d remains)"
msgstr ""

#: ../src/core/ui_callbacks.c:187 ../src/core/ui_callbacks.c:188
#: ../src/core/ui_callbacks.c:192
msgid "Unknown error"
msgstr ""

#: ../src/core/ui_callbacks.c:247 ../src/core/ui_callbacks.c:248
#: ../src/core/ui_callbacks.c:252
msgid "Sending..."
msgstr ""

#: ../src/core/ui_callbacks.c:263 ../src/core/ui_callbacks.c:266
#: ../src/core/ui_callbacks.c:270
msgid "Login completed."
msgstr ""

#: ../src/core/ui_callbacks.c:277 ../src/core/ui_callbacks.c:280
#: ../src/core/ui_callbacks.c:284
#, c-format
msgid ""
"------\n"
Expand All @@ -190,3 +198,15 @@ msgid ""
"The program is running as root. These privileges can harm the system, please "
"be aware of this. Closing."
msgstr ""

#: ../src/core/ui_authorize.c:127
#, c-format
msgid ""
"Error registration:\n"
"Error code: %d\n"
"Message error: %s"
msgstr ""

#: ../src/core/ui_logs.c:49
msgid "Clear log"
msgstr ""
Loading

0 comments on commit 9c477b2

Please sign in to comment.