{"json_modified": "2016-09-28T01:25:37.649342", "uuid": "ef45e4a6-4f00-49a0-9360-25e0e487a915", "title": "App localization code best practices", "url": "/en-US/docs/Archive/Firefox_OS/Firefox_OS_apps/Localization/Localization_code_best_practices", "tags": ["Localization", "l10n", "Apps", "Firefox OS", "Gaia", "L10n", "Best practices"], "translations": [{"uuid": "4634d0ea-da74-4a76-bf5a-3b10e74b06c0", "title": "Gaia \u30ed\u30fc\u30ab\u30e9\u30a4\u30ba\u3059\u308b\u30b3\u30fc\u30c9\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9", "url": "/ja/docs/Mozilla/B2G_OS/Developing_Gaia/localization_code_best_practices", "tags": ["B2G", "Firefox OS", "Localization", "\u30a2\u30d7\u30ea", "Gaia", "L10n", "l10n"], "summary": "\u30ed\u30fc\u30ab\u30e9\u30a4\u30ba\u53ef\u80fd\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u6700\u826f\u306e\u65b9\u6cd5\u306f\u3001l10n\u3010\u8a33\u6ce8: localization\u3001\u3064\u307e\u308a\u30ed\u30fc\u30ab\u30e9\u30a4\u30bc\u30fc\u30b7\u30e7\u30f3\u306e\u7701\u7565\u7cfb\u3011\u306e\u8ad6\u7406\u3092\u53ef\u80fd\u306a\u9650\u308a\u5ba3\u8a00\u7684HTML\u306b\u79fb\u52d5\u3059\u308b\u4e8b\u3067\u3059\u3002", "localization_tags": [], "locale": "ja", "last_edit": "2016-07-10T02:59:33", "review_tags": []}, {"uuid": "b91e892a-abed-4def-b7cf-b21170a27d49", "title": "Melhores pr\u00e1ticas de c\u00f3digo para localiza\u00e7\u00e3o Gaia", "url": "/pt-BR/docs/Mozilla/B2G_OS/Desenvolvendo_Gaia/melhores_praticas_localizacao_gaia", "tags": ["Localiza\u00e7\u00e3o", "B2G", "Firefox OS", "Apps", "Gaia", "L10n", "l10n"], "summary": "A melhor maneira de escrever c\u00f3digo localiz\u00e1vel \u00e9 movendo o m\u00e1ximo de l\u00f3gica l10n para HTML declarat\u00edvel poss\u00edvel. Voc\u00ea deve sempre tentar marcar seus Elementos HTML com data-l10n-id
e-data-l10n-args
\u00a0e apenas definir/remover/atualizar aqueles que usam JavaScript\u00a0se necess\u00e1rio. Voc\u00ea tamb\u00e9m n\u00e3o precisa colocar mais\u00a0o conte\u00fado original em HTML.", "localization_tags": [], "locale": "pt-BR", "last_edit": "2016-07-28T16:09:15", "review_tags": []}], "modified": "2016-05-03T23:04:30", "label": "App localization code best practices", "localization_tags": [], "locale": "en-US", "id": 129183, "last_edit": "2016-05-03T23:03:00", "summary": "The best way to write localizable code is to move as much of l10n logic to declarative HTML as possible. You should always try to mark up your HTML Elements with data-l10n-id
and data-l10n-args
and just set/remove/update those using JavaScript if needed. You also don't need to put the original content in HTML anymore.", "sections": [{"id": "Quick_Links", "title": null}, {"id": "UI_Localization", "title": "UI Localization"}, {"id": "Using_a_declarative_API", "title": "Using a declarative API"}, {"id": "Argument_substitution", "title": "Argument substitution"}, {"id": "Pluralization", "title": "Pluralization"}, {"id": "Removing_localization", "title": "Removing localization"}, {"id": "Do_not_set_l10n-id_on_elements_with_child_elements", "title": "Do not set l10n-id on elements with child elements"}, {"id": "Do_not_use_mozL10n.get", "title": "Do not use mozL10n.get"}, {"id": "mozL10n.ready_will_cause_memory_leaks", "title": "mozL10n.ready will cause memory leaks"}, {"id": "Passing_strings_outside_of_the_app", "title": "Passing strings outside of the app"}, {"id": "Localizing_DOM_Fragments", "title": "Localizing DOM Fragments"}, {"id": "DateTime_Formatting", "title": "Date/Time Formatting"}, {"id": "How_to_write_code_that_operates_on_user-provided_strings_or_l10nIDs", "title": "How to write code that operates on user-provided strings or l10nIDs"}, {"id": "Pattern_1", "title": "Pattern 1"}, {"id": "Pattern_2", "title": "Pattern 2"}, {"id": "Writing_code_that_iterates_over_many_l10n_strings", "title": "Writing code that iterates over many l10n strings"}, {"id": "Writing_APIs_that_operate_on_L10nIDs", "title": "Writing APIs that operate on L10nIDs"}, {"id": "Testing", "title": "Testing"}, {"id": "Notification_API", "title": "Notification API"}], "slug": "Archive/Firefox_OS/Firefox_OS_apps/Localization/Localization_code_best_practices", "review_tags": []}