Localization

myDBR supports multiple languages both on myDBR's own UI and in produced reports.

Localizing myDBR's User Interface for your own language

myDBR's UI's localization strings are located in /interface/languages/-directory. To add support for a new language, add corresponding the language file. You can either fully localize the myDBR UI (including the administrator layouts) or just the terms used in regular user's layouts. Terms starting a keyword 'MYDBR_A' are user layout strings, the rest belong to administrator layouts.

A translation tool is provided in the 'Demo/Translation' section of the admin preferences. The tool shows which terms need to be translated and offers Google Translate's suggestions as a starting point. If you wish to contribute a translation to be distributed as part of myDBR's official updates, please send your translation to support@mydbr.com.

Multilingual support in myDBR

myDBR allows you to support multiple languages both in your report content and in the user interface. myDBR by default selects a UI that matches the user's browser's language setting. Users can choose between available languages by selecting one in the preferences.

  • All report content
  • Report categories
  • Parameter names
  • Report categories
  • Report names
  • Report description
  • Login-screen notification
  • Main-screen notification
  • main_top.html
  • main_sidebar.html
  • Date names in reports (like select monthname(now()))

myDBR uses specially formatted keywords with attached translations to do the localization. The notation used in the text to be translated is #{KEYWORD}. You define the KEYWORD in the localization dialog always available from the localization icon at top banner.

Handling dates in string

It is quite common that you return a string from a database that contains dates. As the string concatenation is already done in the server myDBR cannot use its regular way of determining data types. myDBR offers a formatting option for this via special keyword 'DATE.FORMAT'. A string starting with DATE.FORMAT is considered as a date formatting command that you can define in the localizations. You can define multiple DATE.FORMAT options.

Example of a localized report

We'll create a simple localized report. The report is a chart with month names and text to be localized. First, we'll create the query and replace the text to be localized with keywords. In this case REQUESTS, LAST_YEAR and THIS_YEAR will be localized. myDBR will automatically translate db-functions returning date names.

select 'dbr.chart', 'MSColumn', '#{REQUESTS}'	

select DATE_FORMAT(month_day,'%b'), if (lastyear = 1, '#{LAST_YEAR}', '#{THIS_YEAR}') as type, sum(value)
from production
group by 1, type
order by month desc, type;

We'll store the report (the report name and description can similarly be localized by defining a keyword) and bring out the localization dialog:

When invoked, the localization dialog lets you choose from existing localizations or create a new one. When the dialog is up with selected languages, you can use 'Translate' button to perform automatic translation using Google Translate. Once the keyword is translated the report output will change based on the user's language selection.

English: Finnish:

To select languages available to the users, select them in 'Environment settings' / 'Languages'

Using DATE.FORMAT

We'll define DATE.FORMAT.SHORT as a date formatting string. In the localization dialog, we'll define the string DATE.FORMAT.SHORT as a PHP date formatting string "%d %b %Y" as defined by PHP's strftime. You should define individual formatting for each language.

	select 'dbr.title', concat('This is a localized title: #{DATE.FORMAT.SHORT:',cast(now() as char(20)),'}');

This will produce the title "This is a localized title: 24 Dec 2011" in English and '12 Gen 2012' in Italy.