+ All Categories
Home > Software > Tml for Objective C

Tml for Objective C

Date post: 15-Apr-2017
Category:
Upload: michael-berkovich
View: 65 times
Download: 3 times
Share this document with a friend
36
Powered by Translation Exchange Translation Markup Language for Objective C TranslationExchange.com
Transcript
Page 1: Tml for Objective C

Powered by Translation Exchange

Translation Markup Language for Objective C

TranslationExchange.com

Page 2: Tml for Objective C

Michael [email protected]

@translationx

TranslationExchange.com

Page 3: Tml for Objective C

Localization is hard

Page 4: Tml for Objective C

There are many standards, but little guidance.

Page 5: Tml for Objective C

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

Page 6: Tml for Objective C

Android .xmlApple .stringsApple .plistGettext .poGettext .potJava .properties Java .xmlMicrosoft .resxMicrosoft .reswMicrosoft .resjsonMicrosoft .aspx

FILE FORMATSLots of translation

Microsoft .rcPHP .iniPHP .confLaravel .phpBlackberry .rrcNSIS .inshQT Linguist .tsLatex .latexDocbook .dbkTBX .tbxTMX .tmx

XLIFF .xliffYouTube .sbvRails YAML .yamlSubtitles .srtMicroDVD .subSubviewer .subMozilla Web L10NText .txtCSV SpreadsheetExcel SpreadsheetWord Document

Page 7: Tml for Objective C

Extract content into files (genstrings)

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

BOTTLENECKResource file management is a

Page 8: Tml for Objective C

How can we make itBETTER FOR EVERYONE?

TranslationExchange.com

Page 9: Tml for Objective C

An Ideal Solution

● ConsistentProvide tools that offer a clear and

consistent way for internationalizing

content across all frameworks

● AdaptableTools should be extensible and adaptable

and must be able to solve any arising

internationalization and localization

problem

● ContextualAllow translators to translate in context

from within the application

● AgileKeep the development cycle agile -

localization must not add significant

overhead for developers - it must be done

in parallel to the development process

TranslationExchange.com

Page 10: Tml for Objective C

An integrated and automated continuous localization

あA

Translation Management Service

Global CDNLocal Cache

iOS Application with TMLKit

A Better Way

TranslationExchange.com

Page 11: Tml for Objective C

Translation CachingNo impact on app performance, translations are loaded from local cache.

Inline Translation ToolsTranslation can be done within app context

Access Professional TranslatorsConnect your application to thousands of professional translators around the world

Open SourceSource code is available on github

Multiple PlatformsSupport for iOS, Rails, Node, PHP, Laravel, Python, Django, J2EE, Android and more

Universal Translation MemoryTranslations are shared across all applications

Core Benefits of TML SDK

TranslationExchange.com

Page 12: Tml for Objective C

Getting Started

TranslationExchange.com

Page 13: Tml for Objective C

pod "TMLKit"

Integration

// Podfile

TranslationExchange.com

Page 14: Tml for Objective C

Configuration

// main.m

#import <UIKit/UIKit.h>#import "AppDelegate.h"

int main(int argc, char * argv[]){ @autoreleasepool { [TML sharedInstanceWithApplicationKey:@"YOUR_APP_KEY"]; return UIApplicationMain(argc, argv, nil,

NSStringFromClass([AppDelegate class]) ); }}

TranslationExchange.com

Page 15: Tml for Objective C

Integration Options● Fully automatic

Just activate the SDK, and we do the rest

● Based on NSLocalizedString macrosActivate the SDK, include our header and we take over

● Using TML macrosEnhance the translations with TML macros

TranslationExchange.com

Page 16: Tml for Objective C

Internationalization

// wrap strings with the tr methodNSLocalizedString(@"Hello World", nil)

// use interpolationTMLLocalizedString(@"Hello {user}", @{@"user": @"Alex"})

// and many other features of TML syntax...TMLLocalizedAttributedString(@"Hello [bold: World]")

TranslationExchange.com

Page 17: Tml for Objective C

Translation Markup Language (TML)● Simple, yet powerful, syntax for marking up application strings.

● Supports language context rules and language cases, making translations accurate for any language.

● Backwards compatible to standard I18n

TranslationExchange.com

Page 18: Tml for Objective C

DEMO

Page 19: Tml for Objective C

TML for Objective C Basics

Hello World

Identical syntax is available in Rails, PHP, Java, Python, Javascript, Node.JS, Ember, Angular, etc...

TMLLocalizedString(@”Hello World”)

Page 20: Tml for Objective C

Descriptions

TMLLocalizedString(@”Eats shoots and leaves”, @”a panda”)

Eats shoots and leaves

TMLLocalizedString(@”Eats shoots and leaves”, @”a violent restaurant patron”)

Page 21: Tml for Objective C

Interpolation

TMLLocalizedString(@”Hello {name}”, @{@”name”: @”John”})

Hello John

Page 22: Tml for Objective C

Decoration Tokens

Hello WorldWorld

TMLLocalizedAttributedString('Hello <bold>World</bold>', @{ @”bold”: @{ @"font": [UIFont fontWithName:@"ChalkboardSE-Bold" size:14]

}})

Uses Native Decoration Methods

Page 23: Tml for Objective C

Decoration TokensTMLLocalizedAttributedString(

@”Hello <indent>World</indent>”, @{@”indent”: @”<strong>{$0}</strong>”]

)

TMLLocalizedAttributedString(@”Hello <strong>World</strong>”

)

Hello WorldWorld

or

Page 24: Tml for Objective C

TMLLocalizedAttributedString(

'[bold: {user}] completed [bold: {count || mile}] on [bold: {user | his, her} last run].',

@{@'user’: userObject,@'count’: milesCount

})

More Complex Example

Michael completed 3 miles on his last run.

Page 25: Tml for Objective C

TMLLocalizedString(@”Welcome to {user::pos} blog.”, @{ @”user”: @”Michael”})

Language Cases

Welcome to Michael’s blog.

Page 26: Tml for Objective C

Ordinals

This is your second warning

TMLLocalizedString('This is your {count::ord} warning', @{ @”count”: @2})

Page 27: Tml for Objective C

Genstrings

This is your second warning

$ genstrings ./classes -a TOKEN

Page 28: Tml for Objective C

TranslationExchange.com

TMLDEMO

Page 29: Tml for Objective C

Distribution Options

Packaged BundleAdd a release bundle to your app and it will be unpacked and configured the first time application is run.

Dynamic BundleRelease translations to the CDN and they will be synced down to your application.

TranslationExchange.com

Page 30: Tml for Objective C

How is Translation Done?

Machine Translationprovided by Google, Microsoft and Yandex. Translations are ranked to get the best result.

Crowdsourced TranslationSome developers may choose to use their own users to translate their content, similar to how Facebook and Twitter translated their sites.

Professional TranslationOrder are received and processed by our partners and are made available in our system within hours.

TranslationExchange.com

Page 31: Tml for Objective C

UNIVERSAL TRANSLATIONMEMORY

Page 32: Tml for Objective C

● 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?

Page 33: Tml for Objective C

Hello World Hola Mundo

안녕하세요Привет Мир

Hallo Welt שלום עולם

你好,世界

UTM Graph

Page 34: Tml for Objective C

SUMMARY& CONCLUSION

Page 35: Tml for Objective C

Resources

TMLKit https://github.com/translationexchange/tml-objc

Documentation http://docs.translationexchange.com

Blog http://blog.translationexchange.com

Facebook https://www.facebook.com/translationexchange

Twitter @translationx

Support [email protected]

Page 36: Tml for Objective C

Thank youQUESTIONS?


Recommended