Rename po files to new standard <locale>-<domain>.po

This commit is contained in:
Clemens Schwaighofer
2022-04-14 14:47:58 +09:00
parent c830a32962
commit 46818a6522
10 changed files with 12 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ en_US@latin -> en_US -> en
* en
* en_US
* en_US.UTF-8
* en_US@latin
### Domain
@@ -32,7 +33,9 @@ if not set UTF-8 is assumed. Any other utf8 encoding is changed to UTF-8
## File name example source
`ja_US.admin.UTF-8.po`
`ja-admin.po`
First part is LOCALE, second part is domain. Separator is `-`
## Folder layout
@@ -49,4 +52,4 @@ frontend: dmain (CONTENT_PATH)
## command
`msgfmt -o www/includes/locale/ja_JP/LC_MESSAGES/frontend.UTF-8.mo 4dev/lang/ja_US.admin.UTF-8.po`
`msgfmt -o www/includes/locale/ja/LC_MESSAGES/frontend.mo 4dev/lang/ja.admin.po`

View File

@@ -7,7 +7,10 @@ if [ ! -f "locale/en_US/LC_MESSAGES/admin.mo" ]; then
exit;
fi;
msgfmt -o locale/en_US/LC_MESSAGES/admin.mo locale/en_US.admin.UTF-8.po
msgfmt -o locale/en_US/LC_MESSAGES/frontend.mo locale/en_US.frontend.UTF-8.po
msgfmt -o locale/ja_JP/LC_MESSAGES/admin.mo locale/ja_JP.admin.UTF-8.po
msgfmt -o locale/ja_JP/LC_MESSAGES/frontend.mo locale/ja_JP.frontend.UTF-8.po
for file in $(ls -1 locale/*.po); do
echo $file;
file=$(basename $file .po);
locale=$(echo "${file}" | cut -d "-" -f 1);
domain=$(echo "${file}" | cut -d "-" -f 2);
msgfmt -o locale/${locale}/LC_MESSAGES/${domain}.mo locale/${locale}-${domain}.po;
done;