simple translation hack for omeka

82 views
Skip to first unread message

gjergj sheldija

unread,
Nov 16, 2011, 4:54:38 PM11/16/11
to omek...@googlegroups.com
hi all,

first let me thank you for the great sw that Omeka is.
it has helped us a lot in creating our archive presentation.
we had to make a couple of changes thou, and i would like to share them
with you, hoping it might help someone.

first of all, the default themes in omeka are in english, we wanted them
to show in albanian - the library is in albania - so we made a quick hack
to translate strings in themes and controllers...
the hack is quite simple. i'll give an example how we translated the rhythm theme.
modify the custom.php inside the rhythm folder and add the following lines on the top of the file
$defaultLanguage = Omeka_Context::getInstance()->config->default->language;

$translate = new Zend_Translate(
    array(
            'adapter' => 'ini',
            'content' => BASE_DIR .  '/themes/' . get_option('public_theme').  '/translation/source-' .  $defaultLanguage .  '.ini',
            'locale'  => $defaultLanguage
    )
);

Zend_Registry::set('Zend_Translate', $translate);

create a new directory names translation inside the rhythm folder and add a file names sources-xx.ini, where xx
is the language code.
specify the language code inside config.ini, like default.language = "sq"
and we can start translating the views like :
<?php echo $this->translate('Recently Added Items'); ?>

the next step is to move the language configuration on the administration panel,
so it can be easier to configure and translate also the admin section.

best regards
gjergj sheldija

Patrick Murray-John

unread,
Nov 16, 2011, 6:12:03 PM11/16/11
to omek...@googlegroups.com
Many thanks!

Our next release (1.5) will include internationalization, and this gives
us some helpful ideas about how to implement it.

Hopefully it would not involve too much redoing of work, but as we get
closer to the release, would you be interested in helping produce and
maintain the official Albanian translation for Omeka?

Patrick

> --
> You received this message because you are subscribed to the Google
> Groups "Omeka Dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/omeka-dev/-/mngI3h5cIgMJ.
> To post to this group, send email to omek...@googlegroups.com.
> To unsubscribe from this group, send email to
> omeka-dev+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/omeka-dev?hl=en.

John Flatness

unread,
Nov 16, 2011, 6:44:43 PM11/16/11
to omek...@googlegroups.com
As Patrick mentioned, this is already on the roadmap for Omeka 1.5, and it's something we're focusing on right now.

There's a discussion about internationalization for Omeka on the forums at: http://omeka.org/forums/topic/localization

Our approach differs a little bit from yours (for example, we're using the gettext file format for storing translations), but we're also using Zend_Translate.  In addition, we'll be using Zend's Locale and Date components to allow localizing Omeka's display of dates, which currently are shown in the American-style mm.dd.yyyy format.

We're also working through a system that will allow people to submit translations for Omeka in their language through a web interface, so people who aren't as technically-inclined can more easily contribute.

-John

Gjergj Sheldija

unread,
Nov 17, 2011, 5:57:10 AM11/17/11
to omek...@googlegroups.com
hi,

i'd love to do that!, just tell me where to sign :)

gj.

Gjergj Sheldija

unread,
Nov 17, 2011, 10:08:42 AM11/17/11
to omek...@googlegroups.com
just checked your implementation of the translation..
your's is much better...that avoids having to specify a static language dir

can't wait to 1.5 :)

gj.

Patrick Murray-John

unread,
Nov 21, 2011, 1:37:02 PM11/21/11
to omek...@googlegroups.com
Thanks! We're in the process of testing and making sure that we have all
the strings that should be translated identified. When that's done,
we'll be asking for others to contribute.

Really appreciate it!
Patrick

Reply all
Reply to author
Forward
0 new messages