Skip to content

zend framework 2 - translation on steroids - some thoughts

The following lines are loud thoughts so far. I will give it a try and implement a fitting module for that. But so far, it is really just an idea.

You started your zend framework 2 translation by using the official translation guide for zend framework 2 and it was running fine with some words.
But then, you started working agile, using git flow and doing this by using multiple branches. It turned out that you will get a lot of merge conflicts (also on git) with your translation files if something had changed on your develop branch and on your feature branch. This results in high maintenance costs.

So what to do?
Here is my basic idea. Decouple the translation file from your code.

  • First of all, you want to shift from file based to database based translation.
  • After that, you reduce the usage of the database and add caching

Shift from file based to database based translation

  • Create a database with the name like "translation"
  • Inside this database, create a table called "keys" with the columns "id", "key_name" (or "name") and "created_at"
  • Inside this database, create as many "language" tables as you want
  • Each "language" table has the following columns "id", "key_id", "key_value" (or "value") and "created_at"
  • After that, create a basic import that inserts all names in the table "keys" and all values in the fitting "language" table
  • Next, you have to create an "translation adminstration" frontend to maintain the existing "translation keys" with its fitting "translation values" according to the right language.
  • Finally, you have to overwrite the existing view helper with your own, database driven, one

Reduce the usage of the database and add caching

systemd[1]: Failed to start Create Volatile Files and Directories. - on Arch Linux having zfsonlinux as root

I just got the following entry on my boot up today:

systemd[1]: Failed to start Create Volatile Files and Directories.

After a while of searching using my favorit searchengine, I (as usual ;-)) found the most fitting solution in the bbs.archlinux.org.
The solution is given in the manpage of the tmpfiles.d.
tmpfiles.d(5) wrote:

If the administrator wants to disable a configuration file supplied by the vendor, the recommended way is to place a symlink to /dev/null in /etc/tmpfiles.d/ bearing the same filename.

So all you have to do is:

# sudo su
# cd /usr/lib/tmpfiles.d
# cp journal-nocow.conf journal-nocow.conf.bak
# rm journal-nocow.conf.bak 
# ln -s /dev/null journal-nocow.conf

And thats it. Fingers crossed you system will boot without errors.

web - UpTimes 2015-1 veröffentlicht und bereit zum Download

Heute wurde die aktuelle Ausgabe der GUUG Mitgliederzeitschrift UpTimes veröffentlicht und steht auf der Webseite ab sofort zum Download als PDF und ePUB bereit.
Aus dem Inhalt:
* Das Was-ist-was des Wer-ist-wer: Identifikation, Authentisierung, Autorisierung (von Kristian Köhntopp)
* Von einem, der auszog, IPv6-only zu leben: Hindernisse im IPv4-Netz (von Jens Link)
* Unterwegs nach morgen: Eigener DHCPv6-Server (von Henri Wahl)
* Ist dir langweilig? Bau dir ein Langweilometer (von Jürgen Plate)
* Shellskripte mit Aha-Effekt V: Sirenengeheul und Viertelstundentöne aus der Shell (von Jürgen Plate)
* Change Management: Interview zur Umstellung auf DevOps (mit System Engineer Henning Henkel)
* Angriffsvektor Stromnetz: Buchbesprechung: Blackout (von Hartmut Streppel)

Die Redaktion freut sich über Anregungen, konstruktive Kritik und Artikelvorschläge für zukünftige Ausgaben.

Viel Spaß beim Lesen.
wolfgang

Quelle

Download
Besten Dank :-).