File indexing completed on 2024-04-14 14:08:47

0001 #!/usr/bin/env bash
0002 #=============================================================================
0003 # SPDX-FileCopyrightText: 2019 Johnny Jazeix <jazeix@gmail.com>
0004 #
0005 # SPDX-License-Identifier: GPL-3.0-or-later
0006 #=============================================================================
0007 # Copied from https://cgit.kde.org/plasma-browser-integration.git/tree/StaticMessages.sh
0008 
0009 # We fill in the en "translations" manually. We extract this to the KDE system as pot as normal, then populate the other json files
0010 
0011 # The name of catalog we create (without the.pot extension), sourced from the scripty scripts
0012 FILENAME="gcompris_lang"
0013 
0014 function export_pot_file # First parameter will be the path of the pot file we have to create, includes $FILENAME
0015 {
0016     potfile=$1
0017     python3 ./activities/lang/resource/datasetToPo.py ./activities/lang/resource/words.json $potfile
0018 }
0019 
0020 function import_po_files # First parameter will be a path that will contain several .po files with the format LANG.po
0021 {
0022     podir=$1
0023     for file in `ls $podir`
0024     do
0025         lang=${file%.po} #remove .po from end of file
0026         python3 ./activities/lang/resource/poToDataset.py $podir/$file ./activities/lang/resource/content-$lang.json
0027     done
0028 }