-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathload_translations.sh
33 lines (27 loc) · 973 Bytes
/
load_translations.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
export json_input_folder='./crowdsource-fe/public/locales'
export delta_output_folder='./delta_out'
export meta_output_folder='./meta_files'
export excel_sheet_path='./utils/localization/resources/backup/Vakyansh_All_Content_December_7.xlsx'
export translation_output_path='./crowdsource-fe/public/locales'
export meta_file_location=$meta_output_folder/nextjs_meta.xlsx
echo "Creating Meta File"
mkdir -p $meta_output_folder
python ./utils/localization/delta_generator.py \
-i $json_input_folder \
-o $delta_output_folder \
-a --all-keys --output-type SINGLE_SHEET
mv ./delta_out/out-meta/*.xlsx $meta_file_location
echo "Loading translations"
python ./utils/localization/locale_generator.py \
-j $json_input_folder \
-e $excel_sheet_path \
-m $meta_file_location \
-o $translation_output_path \
-t combined -a
echo "Clear files"
rm $meta_file_location
rm -r $delta_output_folder/*
echo "Format translation files"
cd crowdsource-fe
npm run format