SlideShare a Scribd company logo
1 of 43
Download to read offline
Powered by Translation Exchange
Translation Markup Language
for Laravel
TranslationExchange.com
Michael Berkovich
michael@translationexchange.com
@translationx
TranslationExchange.com
Localization is hard
There are many
standards, but little
guidance.
“
Every i18n framework has its own “right way”
of doing things, with a different syntax and file
format.
Developers often hack together their own
solutions to try and simplify the process.
No universality
in the current
standards
Android .xml
Apple .strings
Apple .plist
Gettext .po
Gettext .pot
Java .properties
Java .xml
Microsoft .resx
Microsoft .resw
Microsoft .resjson
Microsoft .aspx
FILE FORMATS
Lots of translation
Microsoft .rc
PHP .ini
PHP .conf
Laravel .php
Blackberry .rrc
NSIS .insh
QT Linguist .ts
Latex .latex
Docbook .dbk
TBX .tbx
TMX .tmx
XLIFF .xliff
YouTube .sbv
Rails YAML .yaml
Subtitles .srt
MicroDVD .sub
Subviewer .sub
Mozilla Web L10N
Text .txt
CSV Spreadsheet
Excel Spreadsheet
Word Document
Extract content into
files
Upload files to a TMS
or an LSP
Wait... Download translated
files
Put translations back
in your app
Repeat when new content is added or changed
BOTTLENECK
File management is a
File Management
● Not DRY (Don’t Repeat Yourself)
● Requires content extraction, sync with a TMS or an LSP
● Mini “waterfalls” in the agile process
● Slows down development cycle and releases
● High upfront cost and maintenance
How can we make it
BETTER FOR
EVERYONE
TranslationExchange.com
What would an ideal solution
look like?
● Consistency
Provide tools that offer a clear and
consistent way for internationalizing
content across all frameworks
● Adaptability
Tools must be extensible and adaptable
and should be able to solve any arising
internationalization and localization
problem
● Contextualization
Allow translators to translate in context
from within the application
● Agility
Keep the development cycle agile -
localization must not add significant
overhead for developers - it must be done
in parallel to the development process
TranslationExchange.com
あ
A
Translation Management
Service
Global CDN
Local Cache
Laravel Application
with TML SDK
A Better Way
An integrated and truly automated continuous localization
TranslationExchange.com
Translation Caching
Static and dynamic cache adapters for
storing translations in your application
Inline Translation Tools
Translation can be done in context of the
application
Access Professional Translators
Connect your application to thousands of
professional translators around the world
Open Source
All SDKs are available on github
Multiple Platforms
Support for PHP, Laravel, Rails, Node,
Python, iOS, Android and more
Universal Translation Memory
Translations are shared across all
applications
Core Benefits of TML SDK
TranslationExchange.com
Getting Started
TranslationExchange.com
"require": {
"translationexchange/tml": "3.2.12"
}
Integration
// composer.json
TranslationExchange.com
Configuration
// app/Http/Middleware/Tml.php
public function handle($request, Closure $next) {
tml_init([
"key" => "YOUR_APP_KEY",
“cache” => [...]
]);
return $next($request);
}
public function terminate($request, $response) {
tml_complete_request();
}
TranslationExchange.com
Configuration
// app/Http/Kernel.php
protected $middleware = [
...
AppHttpMiddlewareTml::class,
...
];
TranslationExchange.com
Configuration
// resources/views/layouts/application.blade.php
// enable scripts
{!! tml_scripts_tag() !!}
// optionally, add default language selector
{!! tml_language_selector_tag("sideflags") !!}
TranslationExchange.com
Internationalization
// wrap strings with the tr method
{!! tr("Hello World") !!}
// use interpolation
{!! tr("Hello {user}", ["user" => "Michael"]) !!}
// and many other features of TML syntax...
{!! tr("You have {count || message}", ["count" => 5]) !!}
TranslationExchange.com
DEMO
Translation Markup Language
● Developer friendly syntax for marking up application text.
● Supports language context rules and language cases, making
translations accurate for any language.
TranslationExchange.com
TML for Laravel Basics
Hello World
“tr” method is available in Rails, PHP, Java, Obj C, Python, Javascript, Node.JS, Ember, Angular, etc...
{!! tr('Hello World') !!}
Descriptions
tr('Eats shoots and leaves', 'a panda')
Eats shoots and leaves
tr('Eats shoots and leaves', 'a violent restaurant patron')
Interpolation
tr('Hello {name}', ['name' => 'John'])
Hello John
Decoration Tokens
tr('Hello [bold: World]', ['bold’ => '<strong>{$0}</strong>'])
Hello WorldWorld
Decoration Tokens
tr('Hello <indent>World</indent>', ['indent’ => '<strong>{$0}</strong>'])
tr('Hello <strong>World</strong>')
Hello WorldWorld
or
Decoration Tokens
tr('Hello <link>World</link>', ['link’ => [‘href’ => ‘www.google.com’]])
link: ‘<a href=”{$href}”>{$0}</a>’
Hello WorldWorld
where link is a default decoration defined as
Reusing Decoration Tokens
in Other Frameworks (Obj C)
TMLLocalizedString('Hello <bold>World</bold>', @{
@”bold”: @{
@"font": [UIFont fontWithName:@"ChalkboardSE-Bold" size:14]
}
})
iOS Uses Native Decoration Methods
Hello WorldWorld
tr('[link1: {user}] completed [bold: {count || mile}] on
[link2: {user | his, her} last run].',
[
'user’ => $run->user,
'count’ => $run->miles,
'link1’ => [‘href’ => $run->user->url()]],
'link2’ => [‘href’ => $run->url()]],
]
)
More Complex Example
Michael completed 3 miles on his last run.
{!! tml_begin_source('/common/navigation') }}
<ul>
<li>{!! tr('Home') !!}</li>
<li>{!! tr('Features') !!}</li>
<li>{!! tr('Languages') !!}</li>
<li>{!! tr('Pricing') !!}</li>
<li>{!! tr('Docs') !!}</li>
</ul>
{!! tml_finish_source() }}
Sources are arbitrary groups of related translation keys
Sources
{!! trh(“
<ul>
<li>Home</li>
<li>Features</li>
<li>Languages</li>
<li>Pricing</li>
<li>Docs</li>
</ul>
“, [], ['source' => '/common/navigation'] !!}
Automatic String Extraction
Entire blocks can be translated without markup.
{!! trh(“
<nav>
<ul>
<li>You have <a href=’/messages’>unread messages</a></li>
<li><a href=’/logout’>Logout</a></li>
</ul>
</nav>
“, [], ['source' => '/common/navigation'] !!}
Automatic TML Conversion
You have [link: unread messages]
You have unread messages
tr('Welcome to {user::pos} blog.', [
'user’ => 'Michael’
])
Language Cases
Welcome to Michael’s blog.
Ordinals
This is your second warning
tr('This is your {count::ord} warning', [
'count’ => 2
])
TranslationExchange.com
TML
DEMO
Caching Options
Static Cache
File based cache. Loaded into the process
memory and must be deployed with the
source code. Each process contains the
entire translation cache.
Dynamic Cache
Redis, Memcached (and others) updated
from CDN release. Cache is shared
across all processes. Can be deployed
without restarting servers.
TranslationExchange.com
How is Translation Done?
Machine Translation
provided by Google,
Microsoft and Yandex.
Translations are ranked to
get the best result.
Crowdsourced Translation
Some developers may
choose to use their own
users to translate their
content, similar to how
Facebook and Twitter
translated their sites.
Professional Translation
Order are received and
processed by our partners
and are made available in our
system within hours.
TranslationExchange.com
UNIVERSAL
TRANSLATION
MEMORY
● Translations should be reusable across
multiple projects
● Each translation key can have many
translation options for a language based
on context
● Translation keys and translations are
unique and are only stored once in the
entire system
What is UTM?
Hello World Hola Mundo
안녕하세요
Привет Мир
Hallo Welt ‫עולם‬ ‫שלום‬
你好,世界
UTM Graph
SUMMARY
& CONCLUSION
Resources
SDKs https://github.com/translationexchange
Documentation http://translationexchange.com/docs
Blog http://blog.translationexchange.com
Live Sample App http://foody.translationexchange.com
Facebook https://www.facebook.com/translationexchange
Twitter @translationx
Feedback feedback@translationexchange.com
We’re Hiring!
Thank you
QUESTIONS?

More Related Content

What's hot (19)

8 Minutes On Rack
8 Minutes On Rack8 Minutes On Rack
8 Minutes On Rack
 
Psr-7
Psr-7Psr-7
Psr-7
 
Php introduction
Php introductionPhp introduction
Php introduction
 
05php
05php05php
05php
 
httpie
httpiehttpie
httpie
 
Building Awesome APIs with Lumen
Building Awesome APIs with LumenBuilding Awesome APIs with Lumen
Building Awesome APIs with Lumen
 
Control Structures In Php 2
Control Structures In Php 2Control Structures In Php 2
Control Structures In Php 2
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and Libraries
 
Psr 7 symfony-day
Psr 7 symfony-dayPsr 7 symfony-day
Psr 7 symfony-day
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
React with WordPress : Headless CMS
React with WordPress : Headless CMSReact with WordPress : Headless CMS
React with WordPress : Headless CMS
 
System Programming and Administration
System Programming and AdministrationSystem Programming and Administration
System Programming and Administration
 
Php workshop L03 superglobals
Php workshop L03 superglobalsPhp workshop L03 superglobals
Php workshop L03 superglobals
 
Getting Started-with-Laravel
Getting Started-with-LaravelGetting Started-with-Laravel
Getting Started-with-Laravel
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
 
Java JDBC
Java JDBCJava JDBC
Java JDBC
 

Viewers also liked

mantenimiento preventivo
mantenimiento preventivomantenimiento preventivo
mantenimiento preventivoAdolfoMoreno123
 
Birth Injury Medical Malpractice: When Something is Not Quite Right
Birth Injury Medical Malpractice: When Something is Not Quite RightBirth Injury Medical Malpractice: When Something is Not Quite Right
Birth Injury Medical Malpractice: When Something is Not Quite RightHowie, Sacks & Henry
 
Experiences about aflatoxins in Serbia: what could be relevant for Africa?
Experiences about aflatoxins in Serbia: what could be relevant for Africa?Experiences about aflatoxins in Serbia: what could be relevant for Africa?
Experiences about aflatoxins in Serbia: what could be relevant for Africa?Francois Stepman
 
Louisiana's Standards
Louisiana's StandardsLouisiana's Standards
Louisiana's Standardsamberlynn112
 
448.1 Business Analysis Essentials and planning
448.1 Business Analysis Essentials and planning448.1 Business Analysis Essentials and planning
448.1 Business Analysis Essentials and planningRohan Stanny Lopes
 
Residential satisfaction
Residential satisfactionResidential satisfaction
Residential satisfactionSreelakshmi Cj
 
58891 spelling names
58891 spelling names58891 spelling names
58891 spelling namesropaga
 
Digital strategy sarovar hotels
Digital strategy sarovar hotelsDigital strategy sarovar hotels
Digital strategy sarovar hotelssubrat bisht
 
Normas de etiqueta en internet
Normas de etiqueta en internetNormas de etiqueta en internet
Normas de etiqueta en internetrosagarnica
 

Viewers also liked (12)

mantenimiento preventivo
mantenimiento preventivomantenimiento preventivo
mantenimiento preventivo
 
Birth Injury Medical Malpractice: When Something is Not Quite Right
Birth Injury Medical Malpractice: When Something is Not Quite RightBirth Injury Medical Malpractice: When Something is Not Quite Right
Birth Injury Medical Malpractice: When Something is Not Quite Right
 
Experiences about aflatoxins in Serbia: what could be relevant for Africa?
Experiences about aflatoxins in Serbia: what could be relevant for Africa?Experiences about aflatoxins in Serbia: what could be relevant for Africa?
Experiences about aflatoxins in Serbia: what could be relevant for Africa?
 
Louisiana's Standards
Louisiana's StandardsLouisiana's Standards
Louisiana's Standards
 
Academic integrity
Academic integrityAcademic integrity
Academic integrity
 
448.1 Business Analysis Essentials and planning
448.1 Business Analysis Essentials and planning448.1 Business Analysis Essentials and planning
448.1 Business Analysis Essentials and planning
 
MYTOX-Africa
MYTOX-AfricaMYTOX-Africa
MYTOX-Africa
 
Residential satisfaction
Residential satisfactionResidential satisfaction
Residential satisfaction
 
58891 spelling names
58891 spelling names58891 spelling names
58891 spelling names
 
Philippines Nutrition and Labelling Claims 2015
Philippines Nutrition and Labelling Claims 2015Philippines Nutrition and Labelling Claims 2015
Philippines Nutrition and Labelling Claims 2015
 
Digital strategy sarovar hotels
Digital strategy sarovar hotelsDigital strategy sarovar hotels
Digital strategy sarovar hotels
 
Normas de etiqueta en internet
Normas de etiqueta en internetNormas de etiqueta en internet
Normas de etiqueta en internet
 

Similar to Tml for Laravel

Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysqlProgrammer Blog
 
Translation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation MemoryTranslation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation MemoryMichael Berkovich
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails DevsDiacode
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysqldurai arasan
 
R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05zeesniper
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Racksickill
 
C:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse InfocenterC:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse InfocenterSuite Solutions
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
.Net framework
.Net framework.Net framework
.Net frameworkteach4uin
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...bobmcwhirter
 

Similar to Tml for Laravel (20)

Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
 
Tml for Ruby on Rails
Tml for Ruby on RailsTml for Ruby on Rails
Tml for Ruby on Rails
 
Introduction to web and php mysql
Introduction to web and php mysqlIntroduction to web and php mysql
Introduction to web and php mysql
 
Translation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation MemoryTranslation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation Memory
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
Web technology html5 php_mysql
Web technology html5 php_mysqlWeb technology html5 php_mysql
Web technology html5 php_mysql
 
R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05R12 d49656 gc10-apps dba 05
R12 d49656 gc10-apps dba 05
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
AD102 - Break out of the Box
AD102 - Break out of the BoxAD102 - Break out of the Box
AD102 - Break out of the Box
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Rack
 
C:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse InfocenterC:\Users\User\Desktop\Eclipse Infocenter
C:\Users\User\Desktop\Eclipse Infocenter
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
.Net framework
.Net framework.Net framework
.Net framework
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 

Recently uploaded

Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

Tml for Laravel

  • 1. Powered by Translation Exchange Translation Markup Language for Laravel TranslationExchange.com
  • 4. There are many standards, but little guidance. “
  • 5. Every i18n framework has its own “right way” of doing things, with a different syntax and file format. Developers often hack together their own solutions to try and simplify the process. No universality in the current standards
  • 6. Android .xml Apple .strings Apple .plist Gettext .po Gettext .pot Java .properties Java .xml Microsoft .resx Microsoft .resw Microsoft .resjson Microsoft .aspx FILE FORMATS Lots of translation Microsoft .rc PHP .ini PHP .conf Laravel .php Blackberry .rrc NSIS .insh QT Linguist .ts Latex .latex Docbook .dbk TBX .tbx TMX .tmx XLIFF .xliff YouTube .sbv Rails YAML .yaml Subtitles .srt MicroDVD .sub Subviewer .sub Mozilla Web L10N Text .txt CSV Spreadsheet Excel Spreadsheet Word Document
  • 7. Extract content into files Upload files to a TMS or an LSP Wait... Download translated files Put translations back in your app Repeat when new content is added or changed BOTTLENECK File management is a
  • 8. File Management ● Not DRY (Don’t Repeat Yourself) ● Requires content extraction, sync with a TMS or an LSP ● Mini “waterfalls” in the agile process ● Slows down development cycle and releases ● High upfront cost and maintenance
  • 9. How can we make it BETTER FOR EVERYONE TranslationExchange.com
  • 10. What would an ideal solution look like? ● Consistency Provide tools that offer a clear and consistent way for internationalizing content across all frameworks ● Adaptability Tools must be extensible and adaptable and should be able to solve any arising internationalization and localization problem ● Contextualization Allow translators to translate in context from within the application ● Agility Keep the development cycle agile - localization must not add significant overhead for developers - it must be done in parallel to the development process TranslationExchange.com
  • 11. あ A Translation Management Service Global CDN Local Cache Laravel Application with TML SDK A Better Way An integrated and truly automated continuous localization TranslationExchange.com
  • 12. Translation Caching Static and dynamic cache adapters for storing translations in your application Inline Translation Tools Translation can be done in context of the application Access Professional Translators Connect your application to thousands of professional translators around the world Open Source All SDKs are available on github Multiple Platforms Support for PHP, Laravel, Rails, Node, Python, iOS, Android and more Universal Translation Memory Translations are shared across all applications Core Benefits of TML SDK TranslationExchange.com
  • 15. Configuration // app/Http/Middleware/Tml.php public function handle($request, Closure $next) { tml_init([ "key" => "YOUR_APP_KEY", “cache” => [...] ]); return $next($request); } public function terminate($request, $response) { tml_complete_request(); } TranslationExchange.com
  • 16. Configuration // app/Http/Kernel.php protected $middleware = [ ... AppHttpMiddlewareTml::class, ... ]; TranslationExchange.com
  • 17. Configuration // resources/views/layouts/application.blade.php // enable scripts {!! tml_scripts_tag() !!} // optionally, add default language selector {!! tml_language_selector_tag("sideflags") !!} TranslationExchange.com
  • 18. Internationalization // wrap strings with the tr method {!! tr("Hello World") !!} // use interpolation {!! tr("Hello {user}", ["user" => "Michael"]) !!} // and many other features of TML syntax... {!! tr("You have {count || message}", ["count" => 5]) !!} TranslationExchange.com
  • 19. DEMO
  • 20. Translation Markup Language ● Developer friendly syntax for marking up application text. ● Supports language context rules and language cases, making translations accurate for any language. TranslationExchange.com
  • 21. TML for Laravel Basics Hello World “tr” method is available in Rails, PHP, Java, Obj C, Python, Javascript, Node.JS, Ember, Angular, etc... {!! tr('Hello World') !!}
  • 22. Descriptions tr('Eats shoots and leaves', 'a panda') Eats shoots and leaves tr('Eats shoots and leaves', 'a violent restaurant patron')
  • 24. Decoration Tokens tr('Hello [bold: World]', ['bold’ => '<strong>{$0}</strong>']) Hello WorldWorld
  • 25. Decoration Tokens tr('Hello <indent>World</indent>', ['indent’ => '<strong>{$0}</strong>']) tr('Hello <strong>World</strong>') Hello WorldWorld or
  • 26. Decoration Tokens tr('Hello <link>World</link>', ['link’ => [‘href’ => ‘www.google.com’]]) link: ‘<a href=”{$href}”>{$0}</a>’ Hello WorldWorld where link is a default decoration defined as
  • 27. Reusing Decoration Tokens in Other Frameworks (Obj C) TMLLocalizedString('Hello <bold>World</bold>', @{ @”bold”: @{ @"font": [UIFont fontWithName:@"ChalkboardSE-Bold" size:14] } }) iOS Uses Native Decoration Methods Hello WorldWorld
  • 28. tr('[link1: {user}] completed [bold: {count || mile}] on [link2: {user | his, her} last run].', [ 'user’ => $run->user, 'count’ => $run->miles, 'link1’ => [‘href’ => $run->user->url()]], 'link2’ => [‘href’ => $run->url()]], ] ) More Complex Example Michael completed 3 miles on his last run.
  • 29. {!! tml_begin_source('/common/navigation') }} <ul> <li>{!! tr('Home') !!}</li> <li>{!! tr('Features') !!}</li> <li>{!! tr('Languages') !!}</li> <li>{!! tr('Pricing') !!}</li> <li>{!! tr('Docs') !!}</li> </ul> {!! tml_finish_source() }} Sources are arbitrary groups of related translation keys Sources
  • 30. {!! trh(“ <ul> <li>Home</li> <li>Features</li> <li>Languages</li> <li>Pricing</li> <li>Docs</li> </ul> “, [], ['source' => '/common/navigation'] !!} Automatic String Extraction Entire blocks can be translated without markup.
  • 31. {!! trh(“ <nav> <ul> <li>You have <a href=’/messages’>unread messages</a></li> <li><a href=’/logout’>Logout</a></li> </ul> </nav> “, [], ['source' => '/common/navigation'] !!} Automatic TML Conversion You have [link: unread messages] You have unread messages
  • 32. tr('Welcome to {user::pos} blog.', [ 'user’ => 'Michael’ ]) Language Cases Welcome to Michael’s blog.
  • 33. Ordinals This is your second warning tr('This is your {count::ord} warning', [ 'count’ => 2 ])
  • 35. Caching Options Static Cache File based cache. Loaded into the process memory and must be deployed with the source code. Each process contains the entire translation cache. Dynamic Cache Redis, Memcached (and others) updated from CDN release. Cache is shared across all processes. Can be deployed without restarting servers. TranslationExchange.com
  • 36. How is Translation Done? Machine Translation provided by Google, Microsoft and Yandex. Translations are ranked to get the best result. Crowdsourced Translation Some developers may choose to use their own users to translate their content, similar to how Facebook and Twitter translated their sites. Professional Translation Order are received and processed by our partners and are made available in our system within hours. TranslationExchange.com
  • 38. ● Translations should be reusable across multiple projects ● Each translation key can have many translation options for a language based on context ● Translation keys and translations are unique and are only stored once in the entire system What is UTM?
  • 39. Hello World Hola Mundo 안녕하세요 Привет Мир Hallo Welt ‫עולם‬ ‫שלום‬ 你好,世界 UTM Graph
  • 41. Resources SDKs https://github.com/translationexchange Documentation http://translationexchange.com/docs Blog http://blog.translationexchange.com Live Sample App http://foody.translationexchange.com Facebook https://www.facebook.com/translationexchange Twitter @translationx Feedback feedback@translationexchange.com