Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Agility in your translation workflow

Agility in your translation workflow

Matthieu Moquet

June 24, 2014
Tweet

More Decks by Matthieu Moquet

Other Decks in Programming

Transcript

  1. “Agile software development is a group of methods based on

    iterative and incremental development.”
  2. Who makes the translations? When do you translate? How do

    you proceed? What about translations?
  3. Solution #1 Write all translations before starting developments Pros: – 

    Better understanding of the final rendering Cons: –  Can’t update specs later –  Damn slow (not very agile)
  4. Solution #2 Write all translations before deploying Pros: – Development can

    be parallelized – Translations are more concrete Cons: – Still damn slow to deploy
  5. Solution #3 Don’t care about untranslated phrases in production… …since

    it’s not developers’ problem Pros: – Developers are more independent Cons: – Phrases can be untranslated for undefined time – Can’t translate before next release
  6. Solution #4 Decouple your translation process from the development workflow

    Pros: – Developers are totally independent – Easy to update any content strings Cons: – Need tools to follow the translation flow
  7. Developers create the default translations –  in English (sometimes in

    French) –  taken from specifications… or their mind
  8. Translators do the rest – when a feature is developed (before

    production, once it’s on staging) – after deploying (to update default translations) – long after, because of a product change
  9. deploy your code then update your translations Think your translations

    as an independent asset from your code base …like a CMS
  10. o  Create & Update translations with built-in app o  No

    translations stored in code source o  Import from DEV env to PROD when deploying
  11. We then built a similar module with our brand new

    Symfony website… BlablacarTranslationBundle
  12. o  English translations in Yaml files o  Pushed to database

    when staging o  Translators only work on production dataset
  13. <?php namespace Symfony\Component\Translation\Loader; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\Exception\InvalidResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException; /**

    * LoaderInterface is the interface implemented by all translation loaders. */ interface LoaderInterface { /** * Loads a locale. * * @param mixed $resource A resource * @param string $locale A locale * @param string $domain The domain * * @return MessageCatalogue A MessageCatalogue instance */ public function load($resource, $locale, $domain = 'messages'); }
  14. Translations Deployment (lazy mode) o  Avoid querying the database for

    each HTTP request o  Only store the last modification time on a Redis key o  Deploying translations means updating the Redis token HTTP Request Translator isFresh() SELECT translations fwrite app/cache
  15. and there are already some Symfony bundles doing the job

    o  Kunstmaan/KunstmaanTranslatorBundle o  lexik/LexikTranslationBundle o  servergrove/TranslationEditorBundle o  schmittjoh/JMSTranslationBundle o  Elao/ElaoFormTranslationBundle o  Incenteev/IncenteevTranslationCheckerBundle o  matteosister/TranslationBundle o  Wiakowe/TranslationBundle o  Pierstoval/TranslationBundle o  fre5h/TranslationBundle o  GiZystems/TranslationBundle o  dinecat/I18nBundle o  PUGX/PUGXI18nBundle o  emmanuelballery/EBTranslationBundle
  16. But wait… is a bundle the good solution? – What about

    maintaining several applications? – Better to have a centralized platform to perform all the translations
  17. o  Review / approval o  History o  Glossary o  Translation

    Memory o  Projects management o  Team organization o  Comments o  Statistics
  18. o  Crowdsourcing o  Translation Agency o  Translation Memory o  Glossary

    o  Machine Translation o  In-context edition o  Screenshots o  Statistics o  Review/voting system o  Webhooks
  19. Lots of tools, but can’t find a satisfying one Non-adapted

    to our current workflow §  Unable to edit source §  Unable to view/search by translation keys §  No SSO compliant §  etc.
  20. must be fully open source Pleasant to code / play

    with Doesn’t depend on a tier Roll your own auth mechanism
  21. damn simple to use Easy to install / configure Simple

    workflow Minimal interface UX friendly
  22. $ cat openl10n.yml # Server connection server: hostname: "openl10n.dev" username:

    "user" password: "user" # Project specification project: "foobar" # Translation files files: - pattern: "resources/locales/<locale>.yml"
  23. $ openl10n push --locale=all Uploading file resources/locales/de.yml Uploading file resources/locales/en.yml

    Uploading file resources/locales/es.yml Uploading file resources/locales/fr.yml Uploading file resources/locales/it.yml Uploading file resources/locales/pl.yml Uploading file resources/locales/pt.yml ...
  24. $ openl10n pull --locale=all Downloading file resources/locales/de.yml Downloading file resources/locales/en.yml

    Downloading file resources/locales/es.yml Downloading file resources/locales/fr.yml Downloading file resources/locales/it.yml Downloading file resources/locales/pl.yml Downloading file resources/locales/pt.yml ...
  25. Webhooks / Web Eager Deploy translation files on each frontend

    servers Lazy Update a token and let servers update themselves
  26. Webhooks / Mobile Webhook will upload translations on a CDN

    On start-up, mobile app download latest version of translations
  27. Webhooks / Others o Make a PR on GitHub o Push new

    commit o Create backup archives o …
  28. And more to come… •  Proofread mode for editor • 

    History •  Statistics •  Screenshots •  Glossary •  Tags •  Support more formats (Android, iOS, Rails…) •  etc.
  29. or just have a look at the sources if you’re

    just curious github.com/openl10n §  openl10n: The core project (API + javascript client) §  openl10n-sdk: API client (Guzzle 4) §  openl10n-cli: CLI tool §  openl10n.js: In-context translations (not planned yet) §  demo-(silex|symfony|angular|rails): Example of application with a openl10n configuration §  etc.
  30. Back-end / Symfony Domain/ – Split by main components (project, resources,

    translations, etc.) – Unit tests via PHPSpec Bundle/ – Set the infrastructure – Implements API & User management – Functionnal tests via PHPUnit