Lahmizzar Muinela
2014-01-07 0251a9aac9cae56d046de9637504fa9b77b2103c
commit | author | age
ee0fca 1 #!/bin/bash
LM 2
3   ######################################
4   # Author: devXive, Lahmizzar Muinela #
5   # Email: support@devxive.com         #
6   # Twitter: @devXive                  #
7   # Website: http://www.devxive.com    #
8   ######################################
9
10 # Simple script to build an appropriate language manifest
11 #
12 # How to use
0251a9 13 # ./buildManifest [Joomla Language String] [Transifex Language String] [Version]
ee0fca 14 #
LM 15 # > ./buildManifest ru-RU
0251a9 16 #
LM 17 # as used in the pull script
18 # $sourcePath/builder/buildManifest da-DK da_DK $version
19 #
20 # This script is invoked by the pull script to build the appropriate language manifest file
ee0fca 21
LM 22 # Settings
23 name="Projectfork Language - $1"
24 author='Projectfork Translation Team'
25 authorEmail='support@projectfork.net'
26 authorUrl='www.projectfork.net'
27 copyright='(C) 2012 - 2013 by the Projectfork Translation Team. All rights reserved.'
28
29 # Advanced Settings
0251a9 30 filePrefix='lang_pf4_'
ee0fca 31 installVer="2.5"
LM 32
33 ########## ------------------- DO NOT TOUCH BELOW ------------------- ##########
0251a9 34 sourcePath=$(realpath .)
LM 35 rootPath='$sourcePath/languages'
36
37 # Example ver='4.2.0b4'
38 ver="$3"
39 creationDate=''
40
ee0fca 41 # Set language string
LM 42 lang="$1"
43 txLang="$2"
44
45 # Prepare file and directory
46 file="$filePrefix$lang$fileSuffix.xml"
47 dir="$lang"
48
49 rm -rf "$rootPath/$dir/$file"
50 # rm -rf "$rootPath/$dir"
51
52 mkdir "$rootPath/$dir"
53 touch "$rootPath/$dir/$file"
54
55 newFile="$rootPath/$dir/$file"
56
57 if [[ "$creationDate" == "" ]]
58     then
59         creationDate=$(date +"%Y-%m-%d")
60     fi
61
62 echo '<?xml version="1.0" encoding="utf-8"?>' >> "$newFile"
63 echo '<extension type="file" version="'"$installVer"'" method="upgrade">' >> "$newFile"
64 echo "    <name>$name</name>" >> "$newFile"
65 echo "    <author>$author</author>" >> "$newFile"
66 echo "    <creationDate>$creationDate</creationDate>" >> "$newFile"
67 echo "    <copyright>$copyright</copyright>" >> "$newFile"
68 echo "    <license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>" >> "$newFile"
69 echo "    <authorEmail>$authorEmail</authorEmail>" >> "$newFile"
70 echo "    <authorUrl>$authorUrl</authorUrl>" >> "$newFile"
71 echo "    <version>$ver</version>" >> "$newFile"
72 echo "    <description>" >> "$newFile"
73 echo "        <![CDATA[" >> "$newFile"
0251a9 74 # TODO: add a description var to the settings above
ee0fca 75 echo "            The $lang language pack for Projectfork 4, a Project Management extension for Joomla!" >> "$newFile"
LM 76 echo "" >> "$newFile"
77 echo "            <h6>Translation Credits:</h6>" >> "$newFile"
78 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"
79 echo "        ]]>" >> "$newFile"
80 echo "    </description>" >> "$newFile"
81 echo "" >> "$newFile"
82 echo "    <fileset>" >> "$newFile"
83 echo "        <files folder=\"admin\" target=\"administrator/language/$lang\">" >> "$newFile"
84 echo "            <filename>$lang.com_pfcomments.ini</filename>" >> "$newFile"
85 echo "            <filename>$lang.com_pfcomments.sys.ini</filename>" >> "$newFile"
86 echo "            <filename>$lang.com_pfforum.ini</filename>" >> "$newFile"
87 echo "            <filename>$lang.com_pfforum.sys.ini</filename>" >> "$newFile"
88 echo "            <filename>$lang.com_pfmilestones.ini</filename>" >> "$newFile"
89 echo "            <filename>$lang.com_pfmilestones.sys.ini</filename>" >> "$newFile"
90 echo "            <filename>$lang.com_pfprojects.ini</filename>" >> "$newFile"
91 echo "            <filename>$lang.com_pfprojects.sys.ini</filename>" >> "$newFile"
92 echo "            <filename>$lang.com_pfrepo.ini</filename>" >> "$newFile"
93 echo "            <filename>$lang.com_pfrepo.sys.ini</filename>" >> "$newFile"
94 echo "            <filename>$lang.com_pftasks.ini</filename>" >> "$newFile"
95 echo "            <filename>$lang.com_pftasks.sys.ini</filename>" >> "$newFile"
96 echo "            <filename>$lang.com_pftime.ini</filename>" >> "$newFile"
97 echo "            <filename>$lang.com_pftime.sys.ini</filename>" >> "$newFile"
98 echo "            <filename>$lang.com_pfusers.ini</filename>" >> "$newFile"
99 echo "            <filename>$lang.com_pfusers.sys.ini</filename>" >> "$newFile"
100 echo "            <filename>$lang.com_projectfork.ini</filename>" >> "$newFile"
101 echo "            <filename>$lang.com_projectfork.sys.ini</filename>" >> "$newFile"
102 echo "            <filename>$lang.plg_content_pfcomments.ini</filename>" >> "$newFile"
103 echo "            <filename>$lang.plg_content_pfcomments.sys.ini</filename>" >> "$newFile"
104 echo "            <filename>$lang.plg_content_pfnotifications.ini</filename>" >> "$newFile"
105 echo "            <filename>$lang.plg_content_pfnotifications.sys.ini</filename>" >> "$newFile"
106 echo "        </files>" >> "$newFile"
107 echo "" >> "$newFile"
108 echo "        <files folder=\"site\" target=\"language/$lang\">" >> "$newFile"
109 echo "            <filename>$lang.com_projectfork.ini</filename>" >> "$newFile"
110 echo "            <filename>$lang.mod_pf_dash_buttons.ini</filename>" >> "$newFile"
111 echo "            <filename>$lang.mod_pf_dash_buttons.sys.ini</filename>" >> "$newFile"
112 echo "            <filename>$lang.mod_pf_tasks.ini</filename>" >> "$newFile"
113 echo "            <filename>$lang.mod_pf_tasks.sys.ini</filename>" >> "$newFile"
114 echo "        </files>" >> "$newFile"
115 echo "    </fileset>" >> "$newFile"
116 echo "</extension>" >> "$newFile"
117