Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
61d0c4d8
Commit
61d0c4d8
authored
Sep 18, 2024
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
po_file for LANGUAGE en now use .pot file
parent
34b8e0d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
21 deletions
+28
-21
functions_helper
data_from_portwine/scripts/functions_helper
+27
-19
start.sh
data_from_portwine/scripts/start.sh
+1
-2
No files found.
data_from_portwine/scripts/functions_helper
View file @
61d0c4d8
...
...
@@ -103,9 +103,11 @@ generate_pot () {
sed
's/{translations\[/(gettext \"/g'
setup.sh
>
setup.sh_tmp
sed
-i
's/]}/")/g'
setup.sh_tmp
#fixes когда присходит предупреждение: синтаксис $"..." запрещен по соображениям безопасности; используйте eval_gettext
#Когда присходит предупреждение: синтаксис $"..." запрещен по соображениям безопасности; используйте eval_gettext
#удаляется строка без переводов и этим предупреждением (сейчас их всего 3)
sed
-i
'/basename_portwine_exe/d'
functions_helper_tmp
for
lang
in
$LANGUAGES_LIST
do
echo
"
${
lang
}
"
...
...
@@ -146,40 +148,48 @@ TRANSLATIONS_VER=$scripts_install_ver
declare -A translations=(
EOF
if
[[
$LANGUAGE
==
"en"
]]
;
then
po_file
=
"
${
PORT_WINE_PATH
}
/data/locales/
ru/LC_MESSAGES/PortProton.po
"
po_file
=
"
${
PORT_WINE_PATH
}
/data/locales/
PortProton.pot
"
else
po_file
=
"
${
PORT_WINE_PATH
}
/data/locales/
$LANGUAGE
/LC_MESSAGES/PortProton.po"
fi
while
IFS
=
read
-r
line
;
do
while
[[
"
$line
"
=
~ msgid
]]
;
do
while
[[
$line
=
~ msgid
]]
;
do
unset
msgid
msgid
=
"
$line
"
read
-r
line
while
[[
!
"
$line
"
=
~ msgstr
]]
;
do
while
[[
!
$line
=
~ msgstr
]]
;
do
msgid+
=
"
$line
"
read
-r
line
done
if
[[
"
$line
"
=
~ msgstr
]]
;
then
if
[[
$line
=
~ msgstr
]]
;
then
if
[[
$LANGUAGE
==
"en"
]]
;
then
if
[[
$msgid
==
"msgid
\"\"
"
]]
;
then
continue
fi
msgstr
=
"
$msgid
"
else
unset
msgstr
msgstr
=
"
$line
"
read
-r
line
while
[[
!
"
$line
"
=
~ msgid
]]
;
do
msgstr+
=
"
$line
"
while
[[
!
$line
=
~ msgid
]]
;
do
msgstr+
=
$line
read
-r
line
if
[[
$line
==
""
]]
;
then
break
fi
done
fi
fi
msgstr
=
${
msgstr
//
"msgstr "
/
}
if
[[
$LANGUAGE
!=
"en"
]]
;
then
msgstr
=
${
msgstr
//
"msgstr "
/
}
msgid
=
${
msgid
//
"msgid "
/
}
fi
msgstr
=
${
msgstr
//
" "
/-_-
}
msgstr
=
${
msgstr
//
"
\n
"
\
"
\"
/+_+}
msgstr=
${
msgstr
//\
"
\"
/}
msgstr=
${
msgstr
//#*/
}
msgstr=
${
msgstr
//
"*"
/#_#
}
msgid=
${
msgid
//
"msgid "
/
}
msgid=
${
msgid
//
" "
/-_-
}
msgid=
${
msgid
//
"
\n
"
\
"
\"
/+_+}
msgid=
${
msgid
//\
"
\"
/}
...
...
@@ -192,19 +202,17 @@ EOF
echo
\[
"
$msgid
"
\]
="
$msgid
" >> "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
fi
fi
if [[ -z
$msgid
]] && [[ -z
$msgstr
]] ; then
echo "
)
" >> "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
sed -i 's/+_+/
\n
/g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
sed -i 's/#_#/
\*
/g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
sed -i 's/-_-/ /g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
if [[
$LANGUAGE
== "
en
" ]] ; then
sed -i 's/msgid //g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
fi
return 0
fi
done
done < "
$po_file
"
IFS="
$orig_IFS
"
echo "
)
" >> "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
sed -i 's/+_+/
\n
/g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
sed -i 's/#_#/
\*
/g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
sed -i 's/-_-/ /g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
if [[
$LANGUAGE
== "
en
" ]] ; then
sed -i 's/msgid //g' "
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
fi
}
export -f create_translations
...
...
data_from_portwine/scripts/start.sh
View file @
61d0c4d8
...
...
@@ -172,10 +172,9 @@ unset translations
# shellcheck source=/dev/null
source
"
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
if
[[
"
$TRANSLATIONS_VER
"
!=
"
$scripts_install_ver
"
]]
;
then
if
[[
$TRANSLATIONS_VER
!=
"
$scripts_install_ver
"
]]
;
then
try_remove_dir
"
${
PORT_SCRIPTS_PATH
}
/translations"
create_translations
unset
translations
# shellcheck source=/dev/null
source
"
${
PORT_SCRIPTS_PATH
}
/translations/
$LANGUAGE
"
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment