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