Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
32da14fe
Commit
32da14fe
authored
5 years ago
by
jeanluc
Browse files
Options
Downloads
Patches
Plain Diff
Firts try of translation_strings_update.sh
parent
977177fb
Branches
i18n
No related tags found
1 merge request
!117
#265: i18n (using gettext) support with French translation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
translation_strings_update.sh
+15
-2
15 additions, 2 deletions
translation_strings_update.sh
with
15 additions
and
2 deletions
translation_strings_update.sh
+
15
−
2
View file @
32da14fe
...
...
@@ -4,6 +4,7 @@
LOCALES_BASE_DIR
=
locale
MESSAGES_POT_FILE
=
messages.pot
LANGUAGES
=
"fr_FR"
# Save current pot file
...
...
@@ -13,8 +14,20 @@ cp ${LOCALES_BASE_DIR}/${MESSAGES_POT_FILE} ${LOCALES_BASE_DIR}/${MESSAGES_POT_F
xgettext
--from-code
UTF-8
-o
${
LOCALES_BASE_DIR
}
/
${
MESSAGES_POT_FILE
}
silkaj/
*
.py
# copy to en locale and set Language
cp
${
LOCALES_BASE_DIR
}
/
${
MESSAGES_POT_FILE
}
${
LOCALES_BASE_DIR
}
/en/LC_MESSAGES/silkaj.po
sed
s/
\"
Language:
\
/
\"
Language:
\
en/g
-i
${
LOCALES_BASE_DIR
}
/en/LC_MESSAGES/silkaj.po
# make a diff
diff
${
LOCALES_BASE_DIR
}
/
${
MESSAGES_POT_FILE
}
-
$(
date
+%F
)
${
LOCALES_BASE_DIR
}
/
${
MESSAGES_POT_FILE
}
>
${
LOCALES_BASE_DIR
}
/
${
MESSAGES_POT_FILE
}
.diff
# diff ${LOCALES_BASE_DIR}/${MESSAGES_POT_FILE}-$(date +%F) ${LOCALES_BASE_DIR}/${MESSAGES_POT_FILE} > ${LOCALES_BASE_DIR}/${MESSAGES_POT_FILE}.diff
# create other po files
for
var
in
$LANGUAGES
;
do
POFILE
=
${
LOCALES_BASE_DIR
}
/
$var
/LC_MESSAGES/silkaj.po
# echo $POFILE
xgettext
-F
--from-code
UTF-8
-o
$POFILE
-j
$POFILE
silkaj/
*
.py
done
## TODO :
apply diff to other files
## TODO :
compile .mo ?
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment