Commit b96dba74 authored by David Coutadeur's avatar David Coutadeur
Browse files

finish write_i18n for plugin installation

parent 4e20e113
......@@ -67,31 +67,17 @@ $RES"
write_i18n()
{
# TODO: write function
:
# # hash that will contain the result of the "get_i18n" function
# my %get_i18n_result = get_i18n ($locale_dir);
#
# while ( my ($lang, $files) = each %get_i18n_result ) {
#
# # directory wich will contain the .mo file for each language
# my $lang_cache_dir = dir ("$locale_cache_dir/$lang/LC_MESSAGES");
#
# # if $lang_cache_dir doesn't already exists, creating it
# if ( !-d $lang_cache_dir ) {
# $lang_cache_dir->mkpath or die ("! Can't create $locale_cache_dir/$lang/LC_MESSAGES");
# }
#
# # glue .po files's names
# my $po_files = join(" ", @{$files});
# chomp $po_files;
#
# # merging .po files
# system ( "msgcat --use-first ".$po_files.">".$lang_cache_dir."/fusiondirectory.po" ) and die ("! Unable to merge .po files for $lang with msgcat, is it already installed?\n");
#
# # compiling .po files in .mo files
# system ( "msgfmt -o $lang_cache_dir/fusiondirectory.mo $lang_cache_dir/fusiondirectory.po && rm $lang_cache_dir/fusiondirectory.po" ) and die ("! Unable to compile .mo files with msgfmt, is it already installed?\n");
# }
ALL_PO_FILES=$( find ${FD_HOME_PATH} -name 'fusiondirectory.po' -type f )
LANG_LIST=$( printf "${ALL_PO_FILES}" | sed -e 's/^.*\/\([^\/]\+\)\/fusiondirectory\.po$/\1/' | sort -u )
for L in ${LANG_LIST} ; do
PO_FILES=$( printf "${ALL_PO_FILES}" | grep -F "${L}/fusiondirectory.po" | tr '\r\n' ' ')
mkdir -p "${FD_VAR_PATH}/locale/${L}/LC_MESSAGES"
msgcat --use-first ${PO_FILES} > ${FD_VAR_PATH}/locale/${L}/LC_MESSAGES/fusiondirectory.po
msgfmt -o ${FD_VAR_PATH}/locale/${L}/LC_MESSAGES/fusiondirectory.mo ${FD_VAR_PATH}/locale/${L}/LC_MESSAGES/fusiondirectory.po
rm -f ${FD_VAR_PATH}/locale/${L}/LC_MESSAGES/fusiondirectory.po
done
}
......@@ -117,5 +103,5 @@ copy_dir "${PLUGINS_PATH}/${PLUGIN}/locale" "${FD_HOME_PATH}/locale/plugins/${PL
#write_classcache
#write_i18n
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment