commit | author | age
|
ee0fca
|
1 |
#!/bin/bash |
LM |
2 |
|
1fd179
|
3 |
# Copyright (C) 1997 - 2014 devXive - research and development |
LM |
4 |
# |
|
5 |
# The scriptfile is licensed under the Apache License, Version 2.0 (the "License"); |
|
6 |
# You may not use this file except in compliance with the License. |
|
7 |
# You may obtain a copy of the License at |
|
8 |
# |
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
|
10 |
# |
|
11 |
# Unless required by applicable law or agreed to in writing, software |
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 |
# See the License for the specific language governing permissions and |
|
15 |
# limitations under the License. |
|
16 |
# |
|
17 |
# The content of static vars and/or static echo output is licensed under the |
|
18 |
# devXive Proprietary Use License (http://devxive.com/legal/license) |
|
19 |
# |
|
20 |
# Author: devXive, Lahmizzar Muinela |
|
21 |
# Email: support@devxive.com |
|
22 |
# Twitter: @devxive |
|
23 |
# Website: http://devxive.com |
|
24 |
# |
|
25 |
# |
|
26 |
# Description: |
ee0fca
|
27 |
# Simple script to build an appropriate language manifest |
LM |
28 |
# |
|
29 |
# How to use |
0251a9
|
30 |
# ./buildManifest [Joomla Language String] [Transifex Language String] [Version] |
ee0fca
|
31 |
# |
LM |
32 |
# > ./buildManifest ru-RU |
0251a9
|
33 |
# |
LM |
34 |
# as used in the pull script |
|
35 |
# $sourcePath/builder/buildManifest da-DK da_DK $version |
|
36 |
# |
|
37 |
# This script is invoked by the pull script to build the appropriate language manifest file |
ee0fca
|
38 |
|
LM |
39 |
# Settings |
|
40 |
name="Projectfork Language - $1" |
|
41 |
author='Projectfork Translation Team' |
|
42 |
authorEmail='support@projectfork.net' |
|
43 |
authorUrl='www.projectfork.net' |
1fd179
|
44 |
copyright='(C) 2012 - 2014 by the Projectfork Translation Team. All rights reserved.' |
ee0fca
|
45 |
|
LM |
46 |
# Advanced Settings |
0251a9
|
47 |
filePrefix='lang_pf4_' |
ee0fca
|
48 |
installVer="2.5" |
LM |
49 |
|
|
50 |
########## ------------------- DO NOT TOUCH BELOW ------------------- ########## |
0251a9
|
51 |
sourcePath=$(realpath .) |
1a34d5
|
52 |
rootPath="$sourcePath/languages" |
0251a9
|
53 |
|
LM |
54 |
# Example ver='4.2.0b4' |
|
55 |
ver="$3" |
|
56 |
creationDate='' |
|
57 |
|
ee0fca
|
58 |
# Set language string |
LM |
59 |
lang="$1" |
|
60 |
txLang="$2" |
|
61 |
|
|
62 |
# Prepare file and directory |
|
63 |
file="$filePrefix$lang$fileSuffix.xml" |
|
64 |
dir="$lang" |
|
65 |
|
|
66 |
rm -rf "$rootPath/$dir/$file" |
|
67 |
# rm -rf "$rootPath/$dir" |
|
68 |
|
|
69 |
mkdir "$rootPath/$dir" |
|
70 |
touch "$rootPath/$dir/$file" |
|
71 |
|
|
72 |
newFile="$rootPath/$dir/$file" |
|
73 |
|
|
74 |
if [[ "$creationDate" == "" ]] |
|
75 |
then |
|
76 |
creationDate=$(date +"%Y-%m-%d") |
|
77 |
fi |
|
78 |
|
|
79 |
echo '<?xml version="1.0" encoding="utf-8"?>' >> "$newFile" |
|
80 |
echo '<extension type="file" version="'"$installVer"'" method="upgrade">' >> "$newFile" |
|
81 |
echo " <name>$name</name>" >> "$newFile" |
|
82 |
echo " <author>$author</author>" >> "$newFile" |
|
83 |
echo " <creationDate>$creationDate</creationDate>" >> "$newFile" |
|
84 |
echo " <copyright>$copyright</copyright>" >> "$newFile" |
|
85 |
echo " <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>" >> "$newFile" |
|
86 |
echo " <authorEmail>$authorEmail</authorEmail>" >> "$newFile" |
|
87 |
echo " <authorUrl>$authorUrl</authorUrl>" >> "$newFile" |
|
88 |
echo " <version>$ver</version>" >> "$newFile" |
|
89 |
echo " <description>" >> "$newFile" |
|
90 |
echo " <![CDATA[" >> "$newFile" |
0251a9
|
91 |
# TODO: add a description var to the settings above |
ee0fca
|
92 |
echo " The $lang language pack for Projectfork 4, a Project Management extension for Joomla!" >> "$newFile" |
LM |
93 |
echo "" >> "$newFile" |
|
94 |
echo " <h6>Translation Credits:</h6>" >> "$newFile" |
|
95 |
echo " <strong>This translation is brought to you by the <a href=\"https://www.transifex.com/projects/p/projectfork-languages/language/$txLang/members/\" target=\"_blank\">$lang - Translation Team</a></strong>" >> "$newFile" |
|
96 |
echo " ]]>" >> "$newFile" |
|
97 |
echo " </description>" >> "$newFile" |
|
98 |
echo "" >> "$newFile" |
|
99 |
echo " <fileset>" >> "$newFile" |
|
100 |
echo " <files folder=\"admin\" target=\"administrator/language/$lang\">" >> "$newFile" |
|
101 |
echo " <filename>$lang.com_pfcomments.ini</filename>" >> "$newFile" |
|
102 |
echo " <filename>$lang.com_pfcomments.sys.ini</filename>" >> "$newFile" |
|
103 |
echo " <filename>$lang.com_pfforum.ini</filename>" >> "$newFile" |
|
104 |
echo " <filename>$lang.com_pfforum.sys.ini</filename>" >> "$newFile" |
|
105 |
echo " <filename>$lang.com_pfmilestones.ini</filename>" >> "$newFile" |
|
106 |
echo " <filename>$lang.com_pfmilestones.sys.ini</filename>" >> "$newFile" |
|
107 |
echo " <filename>$lang.com_pfprojects.ini</filename>" >> "$newFile" |
|
108 |
echo " <filename>$lang.com_pfprojects.sys.ini</filename>" >> "$newFile" |
|
109 |
echo " <filename>$lang.com_pfrepo.ini</filename>" >> "$newFile" |
|
110 |
echo " <filename>$lang.com_pfrepo.sys.ini</filename>" >> "$newFile" |
|
111 |
echo " <filename>$lang.com_pftasks.ini</filename>" >> "$newFile" |
|
112 |
echo " <filename>$lang.com_pftasks.sys.ini</filename>" >> "$newFile" |
|
113 |
echo " <filename>$lang.com_pftime.ini</filename>" >> "$newFile" |
|
114 |
echo " <filename>$lang.com_pftime.sys.ini</filename>" >> "$newFile" |
|
115 |
echo " <filename>$lang.com_pfusers.ini</filename>" >> "$newFile" |
|
116 |
echo " <filename>$lang.com_pfusers.sys.ini</filename>" >> "$newFile" |
|
117 |
echo " <filename>$lang.com_projectfork.ini</filename>" >> "$newFile" |
|
118 |
echo " <filename>$lang.com_projectfork.sys.ini</filename>" >> "$newFile" |
|
119 |
echo " <filename>$lang.plg_content_pfcomments.ini</filename>" >> "$newFile" |
|
120 |
echo " <filename>$lang.plg_content_pfcomments.sys.ini</filename>" >> "$newFile" |
|
121 |
echo " <filename>$lang.plg_content_pfnotifications.ini</filename>" >> "$newFile" |
|
122 |
echo " <filename>$lang.plg_content_pfnotifications.sys.ini</filename>" >> "$newFile" |
|
123 |
echo " </files>" >> "$newFile" |
|
124 |
echo "" >> "$newFile" |
|
125 |
echo " <files folder=\"site\" target=\"language/$lang\">" >> "$newFile" |
|
126 |
echo " <filename>$lang.com_projectfork.ini</filename>" >> "$newFile" |
|
127 |
echo " <filename>$lang.mod_pf_dash_buttons.ini</filename>" >> "$newFile" |
|
128 |
echo " <filename>$lang.mod_pf_dash_buttons.sys.ini</filename>" >> "$newFile" |
|
129 |
echo " <filename>$lang.mod_pf_tasks.ini</filename>" >> "$newFile" |
|
130 |
echo " <filename>$lang.mod_pf_tasks.sys.ini</filename>" >> "$newFile" |
|
131 |
echo " </files>" >> "$newFile" |
|
132 |
echo " </fileset>" >> "$newFile" |
|
133 |
echo "</extension>" >> "$newFile" |
|
134 |
|