Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
1ef09118
Commit
1ef09118
authored
13 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
add script to build plugins translations
parent
5af3964f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/dev/plugins_translate
+95
-0
95 additions, 0 deletions
scripts/dev/plugins_translate
with
95 additions
and
0 deletions
scripts/dev/plugins_translate
0 → 100755
+
95
−
0
View file @
1ef09118
#!/bin/sh
PYFILES
=
$(
find
-L
./
-type
f
-name
"*.py"
)
GLADEFILES
=
$(
find
-L
./
-type
f
-name
"*.ui"
)
check_args
()
{
if
[
$#
-ne
2
]
;
then
echo
"Missing lang argument"
>
&2
exit
4
fi
}
init_ln
()
{
if
[
-e
"core_plugins"
]
&&
[
!
-L
"core_plugins"
]
;
then
echo
"core_plugins must be a symbolic link"
>
&2
exit
1
fi
if
[
!
-e
"core_plugins"
]
;
then
ln
-s
../../plugins core_plugins
fi
if
[
!
-L
"community_plugins"
]
;
then
echo
"community_plugins should be a symbolic link to gajim-plugins repository, else they won't be in po files"
fi
}
make_pot
()
{
# Generate .ui.h
find
-L
./
-type
f
-name
"*.ui"
-exec
intltool-extract
--type
=
"gettext/glade"
{}
\;
GLADEHFILES
=
$(
find
-L
./
-type
f
-name
"*.ui.h"
)
xgettext
-k_
-kN_
-o
plugins_translations.pot
$PYFILES
$GLADEHFILES
--from-code
=
utf-8
rm
$GLADEHFILES
}
make_po
()
{
if
[
-f
$1
.po
]
;
then
echo
"Updating '
$1
' language"
;
msgmerge
-U
$1
.po plugins_translations.pot
;
else
msginit
-l
$1
.UTF-8
-o
$1
.po
;
fi
}
make_mo
()
{
if
[
!
-f
$1
.po
]
;
then
echo
"
$1
.po doesn't existe. Use plugins_translation make_po
$1
to create it."
;
exit
3
fi
mkdir
-p
locale/
$1
/LC_MESSAGES
msgfmt
-o
$1
.mo
$1
.po
}
install_mo
()
{
if
[
-L
community_plugins
]
;
then
cp
$1
.mo community_plugins/plugins_translate/
fi
mkdir
-p
~/.local/share/gajim/plugins/locale/
$1
/LC_MESSAGES/
cp
$1
.mo ~/.local/share/gajim/plugins/locale/
$1
/LC_MESSAGES/gajim_plugins.mo
}
case
"
$1
"
in
make_po
)
check_args
$@
init_ln
make_pot
make_po
$2
;;
make_mo
)
check_args
$@
make_mo
$2
;;
install_mo
)
install_mo
;;
all
)
check_args
$@
init_ln
make_pot
make_po
$2
make_mo
$2
install_mo
$2
;;
*
)
echo
"Usage: plugins_translation {all|make_po|make_mo|install_mo}"
>
&2
echo
"example: plugins_translation make_po fr_FR"
exit
2
;;
esac
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