mirror of
https://github.com/silentsakky/zarafa-webapp-passwd
synced 2026-08-05 15:03:17 +02:00
Merge pull request #7 from oxilion/translation
Add building of language to build.xml
This commit is contained in:
commit
7badd3b802
5 changed files with 64 additions and 9 deletions
40
build.xml
40
build.xml
|
|
@ -3,6 +3,7 @@
|
||||||
<property name="root-folder" value="${basedir}/../../"/>
|
<property name="root-folder" value="${basedir}/../../"/>
|
||||||
<property name="tools-folder" value="${root-folder}/tools/"/>
|
<property name="tools-folder" value="${root-folder}/tools/"/>
|
||||||
<property name="target-folder" value="${root-folder}/deploy/plugins"/>
|
<property name="target-folder" value="${root-folder}/deploy/plugins"/>
|
||||||
|
<property name="language-folder" value="${basedir}/language"/>
|
||||||
|
|
||||||
<import file="${tools-folder}/antutil.xml"/>
|
<import file="${tools-folder}/antutil.xml"/>
|
||||||
|
|
||||||
|
|
@ -42,6 +43,10 @@
|
||||||
<include name="${plugin-file}"/>
|
<include name="${plugin-file}"/>
|
||||||
<include name="${plugin-debugfile}"/>
|
<include name="${plugin-debugfile}"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
|
<!-- Delete the .mo files -->
|
||||||
|
<fileset dir="${language-folder}">
|
||||||
|
<include name="**/LC_MESSAGES/*.mo"/>
|
||||||
|
</fileset>
|
||||||
</delete>
|
</delete>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|
@ -156,8 +161,40 @@
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- Generate language files -->
|
||||||
|
<target name="language">
|
||||||
|
<if>
|
||||||
|
<available file="msgfmt" filepath="${env.PATH}" />
|
||||||
|
<then>
|
||||||
|
<foreach target="msgfmt" param="file">
|
||||||
|
<path>
|
||||||
|
<fileset dir="${language-folder}">
|
||||||
|
<include name="**/LC_MESSAGES/*.po"/>
|
||||||
|
</fileset>
|
||||||
|
</path>
|
||||||
|
</foreach>
|
||||||
|
</then>
|
||||||
|
<else>
|
||||||
|
<echo message="WARNING: msgfmt not available, not generating *.mo files for translations"/>
|
||||||
|
</else>
|
||||||
|
</if>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="msgfmt">
|
||||||
|
<propertyregex property="outfile" input="${file}" regexp=".*\/(language\/.*)\.po" replace="${target-folder}/${plugin-folder}/\1\.mo"/>
|
||||||
|
<echo message="Converting ${file} to ${outfile}"/>
|
||||||
|
<dirname property="outdir" file="${outfile}"/>
|
||||||
|
<mkdir dir="${outdir}"/>
|
||||||
|
<exec executable="msgfmt" failonerror="true">
|
||||||
|
<arg value="-v"/>
|
||||||
|
<arg value="-o"/>
|
||||||
|
<arg value="${outfile}"/>
|
||||||
|
<arg value="${file}"/>
|
||||||
|
</exec>
|
||||||
|
</target>
|
||||||
|
|
||||||
<!-- Install all files into the target folder -->
|
<!-- Install all files into the target folder -->
|
||||||
<target name="deploy" depends="compress, validate">
|
<target name="deploy" depends="compress, validate, language">
|
||||||
<mkdir dir="${target-folder}/${plugin-folder}"/>
|
<mkdir dir="${target-folder}/${plugin-folder}"/>
|
||||||
|
|
||||||
<!-- Copy (and validate) manifest.xml -->
|
<!-- Copy (and validate) manifest.xml -->
|
||||||
|
|
@ -193,6 +230,7 @@
|
||||||
<exclude name="build.xml"/>
|
<exclude name="build.xml"/>
|
||||||
<!-- CSS is generated during build -->
|
<!-- CSS is generated during build -->
|
||||||
<exclude name="resources/css/*.*"/>
|
<exclude name="resources/css/*.*"/>
|
||||||
|
<exclude name="**/LC_MESSAGES/*.po"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
</target>
|
</target>
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Zarafa.plugins.passwd.settings.PasswdPanel = Ext.extend(Ext.form.FormPanel, {
|
||||||
|
|
||||||
Ext.applyIf(config, {
|
Ext.applyIf(config, {
|
||||||
xtype : 'zarafa.passwdpanel',
|
xtype : 'zarafa.passwdpanel',
|
||||||
labelWidth : 150,
|
labelWidth : 200,
|
||||||
defaults : {
|
defaults : {
|
||||||
width : 200
|
width : 200
|
||||||
},
|
},
|
||||||
|
|
@ -26,11 +26,11 @@ Zarafa.plugins.passwd.settings.PasswdPanel = Ext.extend(Ext.form.FormPanel, {
|
||||||
items : [{
|
items : [{
|
||||||
xtype : 'displayfield',
|
xtype : 'displayfield',
|
||||||
name : 'username',
|
name : 'username',
|
||||||
fieldLabel : 'User name'
|
fieldLabel : dgettext("plugin_passwd", 'User name')
|
||||||
}, {
|
}, {
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
name : 'current_password',
|
name : 'current_password',
|
||||||
fieldLabel : 'Current password',
|
fieldLabel : dgettext("plugin_passwd", 'Current password'),
|
||||||
inputType : 'password',
|
inputType : 'password',
|
||||||
listeners : {
|
listeners : {
|
||||||
change : this.onFieldChange,
|
change : this.onFieldChange,
|
||||||
|
|
@ -39,7 +39,7 @@ Zarafa.plugins.passwd.settings.PasswdPanel = Ext.extend(Ext.form.FormPanel, {
|
||||||
}, {
|
}, {
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
name : 'new_password',
|
name : 'new_password',
|
||||||
fieldLabel : 'New password',
|
fieldLabel : dgettext("plugin_passwd", 'New password'),
|
||||||
inputType : 'password',
|
inputType : 'password',
|
||||||
listeners : {
|
listeners : {
|
||||||
change : this.onFieldChange,
|
change : this.onFieldChange,
|
||||||
|
|
@ -48,7 +48,7 @@ Zarafa.plugins.passwd.settings.PasswdPanel = Ext.extend(Ext.form.FormPanel, {
|
||||||
}, {
|
}, {
|
||||||
xtype : 'textfield',
|
xtype : 'textfield',
|
||||||
name : 'new_password_repeat',
|
name : 'new_password_repeat',
|
||||||
fieldLabel : 'Retype new password',
|
fieldLabel : dgettext("plugin_passwd", 'Retype new password'),
|
||||||
inputType : 'password',
|
inputType : 'password',
|
||||||
listeners : {
|
listeners : {
|
||||||
change : this.onFieldChange,
|
change : this.onFieldChange,
|
||||||
|
|
|
||||||
|
|
@ -76,3 +76,20 @@ msgstr "Wijzig wachtwoord"
|
||||||
# js/PasswdPlugin.js:50:
|
# js/PasswdPlugin.js:50:
|
||||||
msgid "Password Change Plugin"
|
msgid "Password Change Plugin"
|
||||||
msgstr "Wachtwoord wijzigen plugin"
|
msgstr "Wachtwoord wijzigen plugin"
|
||||||
|
|
||||||
|
# js/settings/PasswdPanel.js:29:
|
||||||
|
msgid "User name"
|
||||||
|
msgstr "Gebruikersnaam"
|
||||||
|
|
||||||
|
# js/settings/PasswdPanel.js:33:
|
||||||
|
msgid "Current password"
|
||||||
|
msgstr "Huidig wachtwoord"
|
||||||
|
|
||||||
|
# js/settings/PasswdPanel.js:42:
|
||||||
|
msgid "New password"
|
||||||
|
msgstr "Nieuw wachtwoord"
|
||||||
|
|
||||||
|
#js/settings/PasswdPanel.js:51:
|
||||||
|
msgid "Retype new password"
|
||||||
|
msgstr "Herhaal nieuw wachtwoord"
|
||||||
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<configfile>config.php</configfile>
|
<configfile>config.php</configfile>
|
||||||
</config>
|
</config>
|
||||||
<translations>
|
<translations>
|
||||||
<translationsdir>languages</translationsdir>
|
<translationsdir>language</translationsdir>
|
||||||
</translations>
|
</translations>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class PasswdModule extends Module
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data['new_password'] !== $data['new_password_repeat']) {
|
if($data['new_password'] !== $data['new_password_repeat']) {
|
||||||
$errorMessage = dgettext("plugin_passwd", 'New passwords does not match.');
|
$errorMessage = dgettext("plugin_passwd", 'New passwords do not match.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($errorMessage)) {
|
if(empty($errorMessage)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue