{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-05-30T05:47:54Z","object_id":{"id":1410,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_translation","title":"mod_translation","uri":"https:\/\/zotonic.com\/id\/1410"},"seq":1000000}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"subject":{"objects":[{"created":"2026-09-09T13:48:12Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2588,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_localization_and_translation","title":"Localization and translation","uri":"https:\/\/zotonic.com\/id\/2588"},"seq":3},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":4},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2643,"is_a":["categorization","keyword","keyword_task"],"name":"zotonic_topic_query","title":"Query","uri":"https:\/\/zotonic.com\/id\/2643"},"seq":5},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2668,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_language_code","title":"Language code","uri":"https:\/\/zotonic.com\/id\/2668"},"seq":6},{"created":"2026-09-09T13:48:12Z","object_id":{"id":2669,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_translated_text","title":"Translated text","uri":"https:\/\/zotonic.com\/id\/2669"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2061,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2061"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_translation","page_url":{"en":"https:\/\/zotonic.com\/docs\/2061\/translation","x-default":"https:\/\/zotonic.com\/docs\/2061\/translation"},"preview_url":null,"resource":{"version":3381,"pivot_location_lat":null,"title":"translation","is_authoritative":true,"body":"<p>The m_translation model gives easy access to language and translation related information.<\/p>\n<p>The following <code>m.translation<\/code> model properties are available in templates:<\/p>\n<table class=\"table\"><thead><tr><th>Property<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>language<\/td><td>The current language.<\/td><\/tr><tr><td>language_list<\/td><td>The list of all configured languages.<\/td><\/tr><tr><td>language_list_enabled<\/td><td>The list of all enabled languages.<\/td><\/tr><\/tbody><\/table>\n<p>This is an example of the languages returned by <code>m.translation.language_list<\/code>:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">[{en, [{is_enabled,true}, {language,&lt;&lt;&quot;English&quot;&gt;&gt;}]},\n {fr, [{is_enabled,false}, {language,&lt;&lt;&quot;Français&quot;&gt;&gt;}]},\n {nl, [{is_enabled,true}, {language,&lt;&lt;&quot;Nederlands&quot;&gt;&gt;}]},\n {tr, [{is_enabled,true}, {language,&lt;&lt;&quot;Türkçe&quot;&gt;&gt;}]}].\n<\/code><\/pre>\n<p>For example to list all enabled languages in a select box:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-django\">&lt;select&gt;\n{% for code,props in m.translation.language_list_enabled %}\n  &lt;option value=&quot;{{ code }}&quot; {% if m.translation.language == code %}selected{% endif %}&gt;{{ props.language }}&lt;\/option&gt;\n{% endfor %}\n&lt;\/select&gt;\n<\/code><\/pre>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>get<\/code><\/td><td><code>\/rewrite_url\/...<\/code><\/td><td>Return whether URLs should be rewritten to include language information.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/force_default\/...<\/code><\/td><td>Return whether requests should be forced to the default language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language\/...<\/code><\/td><td>Return the current request language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language_list_configured\/...<\/code><\/td><td>Return languages configured for this site.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language_list_enabled\/...<\/code><\/td><td>Return languages currently enabled for frontend use.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language_list_editable\/...<\/code><\/td><td>Return languages available for content editing.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/default_language\/...<\/code><\/td><td>Return the default site language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/query_language\/...<\/code><\/td><td>Return the language selected from query\/request context.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/x_default_language\/...<\/code><\/td><td>Return whether <code>x-default<\/code> language behavior is enabled.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/main_languages\/...<\/code><\/td><td>Return the set of main languages used by the site.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/all_languages\/...<\/code><\/td><td>Return full language definitions known by the system.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/enabled_language_codes\/...<\/code><\/td><td>Return enabled language codes.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/editable_language_codes\/...<\/code><\/td><td>Return editable language codes.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language_list\/...<\/code><\/td><td>Return language list with metadata.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language_list_sorted\/...<\/code><\/td><td>Return language list sorted for UI\/display usage.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/language_stemmer\/...<\/code><\/td><td>Return configured stemmer language used for search\/indexing.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/default_language_is_fallback\/...<\/code><\/td><td>Return whether the default language is added as fallback language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/name\/+code\/...<\/code><\/td><td>Return local\/native language name for code <code>+code<\/code>.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/english_name\/+code\/...<\/code><\/td><td>Return English language name for code <code>+code<\/code>.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/localized_name\/+code\/...<\/code><\/td><td>Return language name for <code>+code<\/code> localized to the current request language.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/properties\/+code\/...<\/code><\/td><td>Return language properties map for code <code>+code<\/code>.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/translate\/...<\/code><\/td><td>Translate text payload using configured translation services and optional <code>type<\/code>.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/translate_field<\/code><\/td><td>Translate a resource or named-block field without saving. Requires edit permission; payload: <code>id<\/code>, <code>property<\/code>, optional <code>block<\/code>, <code>from<\/code>, <code>to<\/code>.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/has_translation_service\/...<\/code><\/td><td>Return whether any translation service is configured and available.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/detect\/...<\/code><\/td><td>Detect language of supplied text payload.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/detect_enabled\/...<\/code><\/td><td>Detect language only when detection is enabled for the site.<\/td><\/tr><tr><td><code>get<\/code><\/td><td><code>\/has_language\/+rscid\/+language\/...<\/code><\/td><td>Return whether resource <code>+rscid<\/code> has content in language <code>+language<\/code>.<\/td><\/tr><\/tbody><\/table>\n<p><code>\/+name<\/code> marks a variable path segment. A trailing <code>\/...<\/code> means extra path segments are accepted for further lookups.<\/p>","slug":"translation","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"2ad28e8702b0d596517cc545377927815106b0d5745385a933c9c0491b674f5f","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_mod_translation\/src\/models\/m_translation.erl","publication_start":"2023-01-30T19:23:59Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_translation\/src\/models\/m_translation.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_translation","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-05-30T05:47:54Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_translation","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"28493fb676b2d92727e68d4fba20d89c56cf8ead\n","erlang_module":"m_translation","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-15T20:07:38Z","title_slug":"translation"},"uri":"https:\/\/zotonic.com\/id\/2061","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2061"}},"status":"ok"}