Skip to content

Commit

Permalink
Add translation stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
zerocrates committed May 14, 2013
1 parent af53515 commit b7418bd
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com

[omeka-plugin-html5media.main]
file_filter = languages/<lang>.po
source_file = languages/template.pot
source_lang = en
type = PO

2 changes: 2 additions & 0 deletions Html5MediaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public function hookUpgrade($args)

public function hookInitialize()
{
add_translation_source(dirname(__FILE__) . '/languages');

$settings = unserialize(get_option('html5_media_settings'));
$commonOptions = $settings['common']['options'];
add_file_display_callback(array(
Expand Down
50 changes: 50 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Html5Media" basedir=".">
<property name="lang.dir" location="languages" />
<property name="core.pot" location="../../application/languages/Omeka.pot" />
<target name="update-pot" description="Update the translation template.">
<property name="pot.file" location="${lang.dir}/template.pot"/>
<property name="pot.base" location="${lang.dir}/template.base.pot"/>
<tempfile property="pot.temp" suffix=".pot"/>
<tempfile property="pot.duplicates" suffix="-duplicates.pot" />
<copy file="${pot.base}" tofile="${pot.temp}"/>
<apply executable="xgettext" relative="true" parallel="true" verbose="true">
<arg value="--language=php"/>
<arg value="--from-code=utf-8"/>
<arg value="--keyword=__"/>
<arg value="--flag=__:1:pass-php-format"/>
<arg value="--add-comments=/"/>
<arg value="--omit-header"/>
<arg value="--join-existing"/>
<arg value="-o"/>
<arg file="${pot.temp}"/>
<fileset dir="." includes="**/*.php **/*.phtml" excludes="tests/"/>
</apply>
<exec executable="msgcomm">
<arg value="--omit-header" />
<arg value="-o" />
<arg file="${pot.duplicates}" />
<arg file="${pot.temp}" />
<arg file="${core.pot}" />
</exec>
<exec executable="msgcomm">
<arg value="--unique" />
<arg value="-o" />
<arg file="${pot.temp}" />
<arg file="${pot.temp}" />
<arg file="${pot.duplicates}" />
</exec>
<move file="${pot.temp}" tofile="${pot.file}"/>
<delete file="${pot.duplicates}" quiet="true" />
</target>

<target name="build-mo" description="Build the MO translation files.">
<apply executable="msgfmt" dest="${lang.dir}" verbose="true">
<arg value="-o"/>
<targetfile />
<srcfile />
<fileset dir="${lang.dir}" includes="*.po"/>
<mapper type="glob" from="*.po" to="*.mo"/>
</apply>
</target>
</project>
8 changes: 5 additions & 3 deletions config-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@
<div id="html5-media-text-settings">
<h2><?php echo __('Text Settings'); ?></h2>
<p class="explanation">
Text files are data like subtitles and chapter names. HTML5 Media will
include them as tracks of audio or video files with the same original
filename on the same item.
<?php
echo __('Text files are data like subtitles and chapter names. '
. 'HTML5 Media wil include them as tracks of audio or video files with '
. 'the same original filename on the same item.');
?>
</p>
<div class="field">
<div class="two columns alpha">
Expand Down
19 changes: 19 additions & 0 deletions languages/template.base.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation for the Html5Media plugin for Omeka.
# Copyright (C) 2013 John Flatness
# This file is distributed under the GNU General Public License, v3.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Html5Media\n"
"Report-Msgid-Bugs-To: http://github.com/zerocrates/Html5Media/issues\n"
"POT-Creation-Date: 2013-05-14 13:53-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

45 changes: 45 additions & 0 deletions languages/template.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Translation for the Html5Media plugin for Omeka.
# Copyright (C) 2013 John Flatness
# This file is distributed under the GNU General Public License, v3.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Html5Media\n"
"Report-Msgid-Bugs-To: http://github.com/zerocrates/Html5Media/issues\n"
"POT-Creation-Date: 2013-05-14 13:53-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: config-form.php:3
msgid "Video Settings"
msgstr ""

#: config-form.php:22 config-form.php:41 config-form.php:67
msgid "MIME Types"
msgstr ""

#: config-form.php:30 config-form.php:49 config-form.php:75
msgid "Extensions"
msgstr ""

#: config-form.php:38
msgid "Audio Settings"
msgstr ""

#: config-form.php:57
msgid "Text Settings"
msgstr ""

#: config-form.php:60
msgid ""
"Text files are data like subtitles and chapter names. HTML5 Media wil "
"include them as tracks of audio or video files with the same original "
"filename on the same item."
msgstr ""

0 comments on commit b7418bd

Please sign in to comment.