This document discusses data localization and translation in OroCRM. It covers topics like:
- Data localization involves adapting a product for a specific country/region by formatting names, addresses, dates, numbers based on locale.
- Translations are stored in YAML files and the database. Messages are extracted from code and templates.
- OroCRM supports formatting names, addresses, dates, numbers, and currencies based on locale settings. It also provides translation on the backend using the translator service and on the frontend using a JavaScript library.
- Administrators can configure localization settings and use CLI commands to extract, download, merge and upload translations to Crowdin for localization. Debugging options are available to help with
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
"Simple Ways To Be A Better Programmer' as presented at OSCON 2007 by Michael G Schwern.
The audio is still out of sync, working on it. Downloading will be available once the sync is done.
Here, you can get the overview of PERL extraction language. PERL looks like a C-language. so you can learn quickly. at the end of slide you feel you will be familiar with PERL.
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
"Simple Ways To Be A Better Programmer' as presented at OSCON 2007 by Michael G Schwern.
The audio is still out of sync, working on it. Downloading will be available once the sync is done.
Here, you can get the overview of PERL extraction language. PERL looks like a C-language. so you can learn quickly. at the end of slide you feel you will be familiar with PERL.
Number Series: How To Solve Questions with Short TricksEntrance Exam Info
Aspirants who are preparing for competitive Exams, Lear short Tricks to solve Number series problems in just 5 second.
These tricks are really useful for IBPS PO, SSC CGL, Railway Exams & other competitive Exams.
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatRyan Weaver
Testing our applications is something we all do. Ahem, rather, it's something we all *wish* we did. In this chat, I'll introduce you to Behat (behat.org) (version 3!!!!): a behavior-driven-development (BDD) library that allows you to write functional tests against your application just by writing human-readable sentences/scenarios. To sweeten the deal these tests can be run in a real browser (via Selenium2) with just the flip of a switch. If you asked me to develop without Behat, I'd just retire. It's that sweet. By the end, you'll have everything you need to start functionally-testing with Behat in your new, or very old and ugly project.
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYklirantga
THE GATE ACADEMY's GATE Correspondence Materials consist of complete GATE syllabus in the form of booklets with theory, solved examples, model tests, formulae and questions in various levels of difficulty in all the topics of the syllabus. The material is designed in such a way that it has proven to be an ideal material in-terms of an accurate and efficient preparation for GATE.
Quick Refresher Guide : is especially developed for the students, for their quick revision of concepts preparing for GATE examination. Also get 1 All India Mock Tests with results including Rank,Percentile,detailed performance analysis and with video solutions
GATE QUESTION BANK : is a topic-wise and subject wise collection of previous year GATE questions ( 2001 – 2013). Also get 1 All India Mock Tests with results including Rank,Percentile,detailed performance analysis and with video solutions
Bangalore Head Office:
THE GATE ACADEMY
# 74, Keshava Krupa(Third floor), 30th Cross,
10th Main, Jayanagar 4th block, Bangalore- 560011
E-Mail: info@thegateacademy.com
Ph: 080-61766222
Data Structure is the specific method for sorting out the data in a system with the goal that it could be utilized efficiently. These can implement at least one specific abstract data types (ADT), which indicate the operations that can be performed on the data structure and the computational unpredictability of those operations. Copy the link given below and paste it in new browser window to get more information on Data Structure & Algorithms:- www.transtutors.com/homework-help/computer-science/data-structure-and-algorithms.aspx
Computer Science & Information Systems
First attempt to offer a broad view of CS & IS field by comparing and relate its disciplines
Luis Borges Gouveia
November 2013
Internationalizing CakePHP ApplicationsPierre MARTIN
Slides from the talk given by Mariano Iglesias during the CakeFest #3 - July 2009
Note: the original pdf and the code related to this talk can be found on cakephp.org (http://cakephp.org/downloads/CakeFest/CakeFest%203%20-%20Berlin%202009/Mariano%20Iglesias%20-%20Internationalizing%20CakePHP%20Applications)
Number Series: How To Solve Questions with Short TricksEntrance Exam Info
Aspirants who are preparing for competitive Exams, Lear short Tricks to solve Number series problems in just 5 second.
These tricks are really useful for IBPS PO, SSC CGL, Railway Exams & other competitive Exams.
Grand Rapids PHP Meetup: Behavioral Driven Development with BehatRyan Weaver
Testing our applications is something we all do. Ahem, rather, it's something we all *wish* we did. In this chat, I'll introduce you to Behat (behat.org) (version 3!!!!): a behavior-driven-development (BDD) library that allows you to write functional tests against your application just by writing human-readable sentences/scenarios. To sweeten the deal these tests can be run in a real browser (via Selenium2) with just the flip of a switch. If you asked me to develop without Behat, I'd just retire. It's that sweet. By the end, you'll have everything you need to start functionally-testing with Behat in your new, or very old and ugly project.
Computer Science Engineering : Data structure & algorithm, THE GATE ACADEMYklirantga
THE GATE ACADEMY's GATE Correspondence Materials consist of complete GATE syllabus in the form of booklets with theory, solved examples, model tests, formulae and questions in various levels of difficulty in all the topics of the syllabus. The material is designed in such a way that it has proven to be an ideal material in-terms of an accurate and efficient preparation for GATE.
Quick Refresher Guide : is especially developed for the students, for their quick revision of concepts preparing for GATE examination. Also get 1 All India Mock Tests with results including Rank,Percentile,detailed performance analysis and with video solutions
GATE QUESTION BANK : is a topic-wise and subject wise collection of previous year GATE questions ( 2001 – 2013). Also get 1 All India Mock Tests with results including Rank,Percentile,detailed performance analysis and with video solutions
Bangalore Head Office:
THE GATE ACADEMY
# 74, Keshava Krupa(Third floor), 30th Cross,
10th Main, Jayanagar 4th block, Bangalore- 560011
E-Mail: info@thegateacademy.com
Ph: 080-61766222
Data Structure is the specific method for sorting out the data in a system with the goal that it could be utilized efficiently. These can implement at least one specific abstract data types (ADT), which indicate the operations that can be performed on the data structure and the computational unpredictability of those operations. Copy the link given below and paste it in new browser window to get more information on Data Structure & Algorithms:- www.transtutors.com/homework-help/computer-science/data-structure-and-algorithms.aspx
Computer Science & Information Systems
First attempt to offer a broad view of CS & IS field by comparing and relate its disciplines
Luis Borges Gouveia
November 2013
Internationalizing CakePHP ApplicationsPierre MARTIN
Slides from the talk given by Mariano Iglesias during the CakeFest #3 - July 2009
Note: the original pdf and the code related to this talk can be found on cakephp.org (http://cakephp.org/downloads/CakeFest/CakeFest%203%20-%20Berlin%202009/Mariano%20Iglesias%20-%20Internationalizing%20CakePHP%20Applications)
Kicking off with Zend Expressive and Doctrine ORM (ZendCon 2016)James Titcumb
You've heard of the new Zend framework, Expressive, and you've heard it's the new hotness. In this talk, I will introduce the concepts of Expressive, how to bootstrap a simple application with the framework using best practices, and how to integrate a third party tool like Doctrine ORM.
Zend_Config simplifies the access to, the use of, and writing of, configuration data within applications.
The configuration data may come from a variety of media supporting hierarchical data storage.
Adapters for Arrays, ini and XML files are provided.
Migrating from drupal to plone with transmogrifierClayton Parker
Transmogrifier is a migration framework that can help you easily migrate from one platform to another. It has been written in a way that allows re-use of migration code through blueprints. In this talk we will walk through the steps necessary to migrate from Drupal, a popular CMS written in PHP, into Plone. We will see how to use the various blueprints available to build a pipeline that prepares and imports the content into Plone
A presentation on how to semi-automatically build CRUD application prototypes using PHP and some PEAR libraries. This was way before Rails became popular and automatic form generation for web applications was not as common as it is now.
Also, it was the first public presentation I ever held. Ah, those were the times ;-)
Originally held at the International PHP Conference 2004 in Amsterdam, although these slides have been updated by project contributors to reflect feature additions that were implemented later.
Kicking off with Zend Expressive and Doctrine ORM (PHPNW2016)James Titcumb
You've heard of Zend's new framework, Expressive, and you've heard it's the new hotness. In this talk, I will introduce the concepts of Expressive, how to bootstrap a simple application with the framework using best practices, and finally how to integrate a third party tool like Doctrine ORM.
Presented at Open Source 101 2023 - Charlotte
Presented by Kerim Satirli, HashiCorp
Title: How to Get Your Website Into the Cloud
Abstract: In this workshop, Kerim will teach how to deploy your GitHub portfolio (or any other a static website) to your favourite cloud provider's hosting service.
As part of this workshop, attendees can expect to learn:
* what Infrastructure as Code is and why it is important
* how to use Terraform to get data from GitHub and deploy it to any cloud provider
* what pitfalls to avoid and what best practices to consider
The workshop is highly interactive and attendees are encouraged to bring their own laptops to follow along.
Attendees do not need to have a static website of their own at the time of the workshop, as the workshop material uses the GitHub API to "generate" a website for each attendee.
To find more presentations by Kerim Satirli: https://speakerdeck.com/ksatirli/
Gentle introduction to Pyramid. Where it comes from, how simple it, how fast, how flexible and why the future will be pyramid shaped.
Made for pyconau 2011
1. Data Localization and Translation
Data Localization
and
Translation
Yevhen Shyshkin
yshyshkin@orocrm.com
https://github.com/yshyshkin
2. Data Localization and Translation
Language localisation is the process of
adapting a product that has been previously
translated into different languages to a
specific country or region.
What is language localization?
3. Data Localization and Translation
Where localization is applied?
- Name formatting
- Address formatting
- Datetime formatting
- Number formatting
- Decimal
- Integer
- Percent
- Currency
4. Data Localization and Translation
Localization configuration
System > Configuration > Localization
5. Data Localization and Translation
Localization configuration
$this->get('oro_locale.settings')->getLocale();
$this->get('oro_locale.settings')->getCurrency();
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Model/LocaleSettings.php
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Resources/public/js/locale-
settings.js
Result: en
USD
PHP:
JS: require(['orolocale/js/locale-settings'],
function(localeSettings) {
localeSettings.getLocale();
localeSettings.getCurrency();
});
Twig: {{ oro_locale() }}
{{ oro_currency() }}
6. Data Localization and Translation
Name formatting
- Names are formatted based on locale
- Name format configuration can be defined in any
bundle’s YAML file
Resources/config/oro/name_format.yml
- Format may contain placeholders for name
prefix, name suffix, first name,
last name and middle name
- Entity must include OroBundle
LocaleBundleModelFullNameInterface
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Model/FullNameInterface.php
7. Data Localization and Translation
Name formatting
en: %prefix% %first_name% %middle_name% %last_name% %suffix%
en_US: %prefix% %first_name% %middle_name% %last_name% %suffix%
ru: %last_name% %first_name% %middle_name%
ru_RU: %last_name% %first_name% %middle_name%
Configuration example
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/LocaleBundle/Resources/config/oro/name_format.yml
8. Data Localization and Translation
Name formatting
$user = new User(); // implements FullNameInterface
$user->setNamePrefix('Mr.')
->setFirstName('John')
->setMiddleName('S.')
->setLastName('Doe')
->setNameSuffix('Jr.');
$this->get('oro_locale.formatter.name')->format($user);
$this->get('oro_locale.formatter.name')->format($user, 'ru');
PHP:
Twig: {{ entity|oro_format_name }}
{{ entity|oro_format_name('ru') }}
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Formatter/NameFormatter.php
9. Data Localization and Translation
Name formatting
require(['orolocale/js/formatter/name'],
function(nameFormatter) {
var user = {
'prefix': 'Mr.',
'first_name': 'John',
'middle_name': 'S.',
'last_name': 'Doe',
'suffix': 'Jr'
};
nameFormatter.format(user);
nameFormatter.format(user, 'ru');
});
JS:
Result: Mr. John S. Doe Jr.
Doe John S.
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/LocaleBundle/Resources/public/js/formatter/name.js
10. Data Localization and Translation
Address formatting
- Addresses are formatted based on primary
location or country address
- Address format configuration can be defined in
any bundle’s YAML file
Resources/config/oro/address_format.yml
- Format may contain placeholders for name,
organization, street, city, region, region code,
country, country code and postal code
- Entity must include OroBundle
LocaleBundleModelAddressInterface
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Model/AddressInterface.php
11. Data Localization and Translation
Address formatting
US:
format: '%name%n%organization%n%street%n%CITY% %REGION_CODE% %
COUNTRY_ISO2% %postal_code%'
require: [street, city, region, postal_code]
zip_name_type: zip
region_name_type: region
RU:
format: '%postal_code% %COUNTRY% %CITY%n%STREET%n%organization%
n%name%'
require: [street, city, postal_code]
Configuration example
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/LocaleBundle/Resources/config/oro/address_format.yml
12. Data Localization and Translation
Address formatting
$country = new Country('US');
$country->setName('United States of America')
->setIso3Code('USA');
$region = new Region('US-CA');
$region->setCode('CA')
->setName('California');
$address = new Address(); // implements AddressInterface
$address->setNamePrefix('Mr.')
->setFirstName('John')
->setMiddleName('S.')
->setLastName('Doe')
->setNameSuffix('Jr.');
$address->setStreet('Random str., 3, 14')
->setCity('Los Angeles')
->setRegion($region)
->setCountry($country)
->setPostalCode('12345')
->setOrganization('Oro Inc.');
$this->get('oro_locale.formatter.address')->format($address);
PHP:
14. Data Localization and Translation
Address formatting
Result: Mr. John S. Doe Jr.
Oro Inc.
Random str., 3, 14
LOS ANGELES CA US 12345
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Formatter/AddressFormatter.php
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/LocaleBundle/Resources/public/js/formatter/address.js
15. Data Localization and Translation
Datetime formatting
- Datetime values are formatted based on locale,
timezone and type (none, short, medium, long,
full)
- Datetime format configuration extracted from
libicu via PHP INTL extension
- Datetime formatter accepts DateTime object,
string and timestamp values
16. Data Localization and Translation
Datetime formatting
PHP: $dateTime = new DateTime(
'2011-12-13 14:15:16',
new DateTimeZone('UTC')
);
$formatter = $this->get('oro_locale.formatter.date_time');
$formatter->format($dateTime);
$formatter->formatDate($dateTime->format('Y-m-d'));
$formatter->formatTime($dateTime->getTimestamp());
Result: Dec 13, 2011 4:15 PM
Dec 13, 2011
4:15 PM
https://github.com/orocrm/platform/blob/1.6.0/src/Oro/Bundle/LocaleBundle/Formatter/DateTimeFormatter.php
17. Data Localization and Translation
Datetime formatting
JS: require(['orolocale/js/formatter/datetime'],
function(datetimeFormatter) {
datetimeFormatter.formatDateTime('2011-12-13T14:15:16+0000');
datetimeFormatter.formatDate('2011-12-13');
datetimeFormatter.formatTime('14:15:16');
});
Twig: {{ '2011-12-13 14:15:16'|oro_format_datetime }}
{{ '2011-12-13'|oro_format_date }}
{{ '14:15:16'|oro_format_time }}
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/LocaleBundle/Resources/public/js/formatter/datetime.js
Result: Dec 13, 2011 4:15 PM
Dec 13, 2011
2:15 PM
18. Data Localization and Translation
Datetime format handling
- Different libraries use different datetime formats
- Oro Platform provides format converters for
libicu, moment.js and jquery.ui
- New formatters can be registered using DI tag
oro_locale.format_converter.date_time
19. Data Localization and Translation
Datetime timezone handling
- To simplify timezone handling all DateTime
object in the backend should be in UTC
timezone
- DateTime objects saved to the DB and
extracted from the DB are automatically
converted to UTC timezone
- Formatting of DateTime objects should be
performed using DateTimeConverter via
service oro_locale.formatter.date_time
20. Data Localization and Translation
Number formatting
- Numbers are formatted based on locale
- Formatter works with decimal, percent, currency,
spellout, duration and ordinal values
- Number format configuration extracted from
libicu via PHP INTL extension
- Currency use symbols from YAML files
Resources/config/oro/currency_data.yml
22. Data Localization and Translation
Number formatting
require(['orolocale/js/formatter/number'],
function(numberFormatter) {
numberFormatter.formatDecimal(12345.6789);
numberFormatter.formatInteger(12345);
numberFormatter.formatPercent(1.2345);
numberFormatter.formatCurrency(12345.6789);
numberFormatter.formatCurrency(12345.6789, 'EUR');
});
JS:
Result: 12,345.679
12,345
123.45%
$12,345.68
€12,345.68
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/LocaleBundle/Resources/public/js/formatter/number.js
23. Data Localization and Translation
Localization CLI commands
oro:localization:dump - dump localization
configuration from YAML files to web/js/oro.
locale_data.js
24. Data Localization and Translation
Translation is the communication of the
meaning of a source-language text by
means of an equivalent target-language text.
What is translation?
25. Data Localization and Translation
Oro Platform use standard Symfony2 mechanism to
perform frontend translation in PHP, in Twig
templates, and translator.js library from
BazingaJsTranslationBundle
Translations are stored in YAML files in any bundle
and in the application database.
How translations used in
Oro Platform?
26. Data Localization and Translation
- messages - common messages used both for
system and custom purposes
- validators - validation messages
- jsmessages - messages translated on frontend
side
- tooltips - messages for and form field tooltips
- entity - data for entities translated with Gedmo
translatable extension
Translation domains
27. Data Localization and Translation
Recommended
translation message format
<application>.<bundle>.<section>.<key>
oro.user.form.choose_gender
oro.dataaudit.change_history.title
oro.entity_config.menu.entities_list.label
Format:
Examples:
28. Data Localization and Translation
Translation extractors
- PhpCodeExtractor - extracts formatted
strings from PHP code
- NavigationTranslationExtractor -
extracts title translations from navigation.
yml files
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/TranslationBundle/Extractor/PhpCodeExtractor.php
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/NavigationBundle/Title/TranslationExtractor.php
30. Data Localization and Translation
Translation on frontend
require(['orotranslation/js/translator'],
function(__) {
__('oro.note.add_note_title');
__('oro.datagrid.pagination.totalRecords', {totalRecords: 42});
});
JS:
Result: Add note
Total of 42 records
# jsmessages.en.yml
oro.note.add_note_title: "Add note"
oro.datagrid.pagination:
totalRecords: "Total of {{ totalRecords }} records"
YAML:
31. Data Localization and Translation
Translation in the database
- table oro_translation
- entity OroTranslationBundle:Translation
- scopes SYSTEM and UI
# id
# key
# value
# locale
# domain
# scope
Translation
32. Data Localization and Translation
Translation in database
- OrmTranslationLoader - loads
translations from database
- DatabasePersister - persists translations
to database
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/TranslationBundle/Translation/OrmTranslationLoader.php
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/TranslationBundle/Translation/DatabasePersister.php
33. Data Localization and Translation
Translation configuration
System > Configuration > Language settings
34. Data Localization and Translation
Interaction with Crowdin
- Dump translations from translation extractors
and YAML files
- Download translations from Crowdin
- Merge them with existing translations
- Upload updated translations to Crowdin
Oro Platform Crowdin
1. dump 2. download
3. merge
4. upload
35. Data Localization and Translation
Debug translator
- Wraps translated strings in square brackets -
[<string>]
- Wraps not translated strings into exclamation
marks - !!!---string---!!!
- Add JS prefix for frontend translations
- can be enabled in app/config/config.yml
oro_translation:
debug_translator: true
https://github.com/orocrm/platform/blob/1.6.0
/src/Oro/Bundle/TranslationBundle/Translation/DebugTranslator.php
37. Data Localization and Translation
Translation CLI commands
oro:translation:dump - dumps frontend
translations into web/js/translation/<locale>.js
oro:translation:pack - extracts translation files
for each bundle in specified vendor namespace
and creates language pack