{"id":17962304,"url":"https://github.com/richtr/opera-11-extensions--auto-i18n-library","last_synced_at":"2025-10-13T04:41:41.004Z","repository":{"id":1245351,"uuid":"1183797","full_name":"richtr/Opera-11-Extensions--Auto-I18N-Library","owner":"richtr","description":"Auto-translation library for Opera 11+ Extensions","archived":false,"fork":false,"pushed_at":"2010-12-28T16:27:22.000Z","size":132,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T19:19:32.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richtr.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-12-20T09:01:06.000Z","updated_at":"2014-04-24T09:50:40.000Z","dependencies_parsed_at":"2022-07-06T13:54:00.812Z","dependency_job_id":null,"html_url":"https://github.com/richtr/Opera-11-Extensions--Auto-I18N-Library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/richtr/Opera-11-Extensions--Auto-I18N-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richtr%2FOpera-11-Extensions--Auto-I18N-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richtr%2FOpera-11-Extensions--Auto-I18N-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richtr%2FOpera-11-Extensions--Auto-I18N-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richtr%2FOpera-11-Extensions--Auto-I18N-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richtr","download_url":"https://codeload.github.com/richtr/Opera-11-Extensions--Auto-I18N-Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richtr%2FOpera-11-Extensions--Auto-I18N-Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013687,"owners_count":26085390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T11:18:46.472Z","updated_at":"2025-10-13T04:41:40.986Z","avatar_url":"https://github.com/richtr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" Auto Internationalization (I18N) Library for Opera Extensions\n -------------------------------------------------------------- \n Written by Rich Tibbett.\n Distributed under the Creative Commons Sharealike License:\n   http://creativecommons.org/licenses/by-sa/2.5/\n \n The Auto I18N library for Opera 11+ extensions provides a convenient way for developers to \n include multi-language support within their extensions without having to include those \n translations manually.\n \n This library creates an API at opera.extensions.i18n for developers to quickly and easily \n add internationalization and localization support to their extensions.\n\n A developer simply need write a single messages.js file, in the language of their choice, \n and that will be localized according to their users' locales.\n \n Follow these simple instructions to configure and use this library from\n your Background, Popup and/or Injected Script processes:\n \n --------------------------\n Configuration\n --------------------------\n \n 1. Add the following line to your configuration document (/config.xml):\n \n \t\t\u003caccess origin=\"https://ajax.googleapis.com\" /\u003e\n \n 2. Create your reference strings in /messages.js in the language of your choice. You can add \n    placeholders as \u003cstring/\u003e in to which you can dynamically inject content at runtime as \n    required. \n    \n    You may also use \u003cyour text!\u003e to indicate that you would not like 'your text' to be \n    translated in a given message. At run time, any \u003c...!\u003e syntax will be removed and replaced \n    with the inner text included.\n    \n    See the included /messages.js file for format and examples.\n \n Instructions for then using this library within your background process, popup process or \n injected script processes are included below.  \n \n ---------------\n General Usage:\n ---------------\n \n 1. Include the following lines in your Background process (typically /index.html):\n \n \t\t\u003cscript type=\"text/javascript\" src=\"messages.js\"\u003e\u003c/script\u003e\n \t\t\u003cscript type=\"text/javascript\" src=\"i18n_lib.js\"\u003e\u003c/script\u003e\n \n 2. Copy and paste the /snippet.js file once at the *top* of each Popup or Injected Script \n    target file(s).\n \n 3. Access your localized messages by their *id* as follows within Javascript:\n \n \t\topera.extension.i18n.getMessage('welcomeMessage');\n \t\topera.extension.i18n.getMessage('helpButtonString');\n\t\t// etc...\n\t\t\n\tYou can also replace \u003cstring/\u003e placeholders in your messages at runtime as follows:\n\t\n    \topera.extension.i18n.getMessage('somemessage', [ \"string1\", \"string2\" ]);\n    \topera.extension.i18n.getMessage('sign_in_required_message', [ \n    \t    opera.extension.i18n.getMessage('sign_in_message') \n    \t]);\n    \t// etc...\n\t\t\n \n That's all you need for complete auto-localization of your extension.\n \n -------------------------------------\n Using pre-defined translation files:\n -------------------------------------\n\n Opera 11+ Extensions support the W3C Widgets I18N model. This library is compatible with \n this model and you may include pre-defined translations in the normal way.\n\n If you have, for example, a pre-defined messages.js file that has been translated in to \n French, you may include this in your extension within a /locales/fr/ directory.\n\n Your extension will use any pre-defined locales files over any auto-translation capabilities \n provided by this library.\n\n For full details of the W3C Widgets I18N Model used in Opera extensions please consult the \n spec at: \n\n \thttp://dev.w3.org/2006/waf/widgets/#internationalization-and-localization \n\n ------------------------\n On-demand Translations:\n ------------------------\n \n In addition to localizing your strings defined in your messages.js, this library can also \n provide on-demand localization/translation for any messages you wish.\n \n To use the on-demand localization feature, follow these instructions:\n \n 1. Once again, make sure that i18n_lib.js is included in your Background process page \n    (typically in index.html).\n \n \t\t\u003cscript type=\"text/javascript\" src=\"i18n_lib.js\"\u003e\u003c/script\u003e\n \n 2. Copy and paste the /snippet.js file once at the *top* of each Popup or Injected Script \n    target file(s).\n \n 3. Perform on-demand translation/localization with the following code:\n \n \t\topera.extension.i18n.localize(\n \t\t\t{\n \t\t\t\t'mystring1': {\n \t\t\t\t\t'message': 'string 1 to translate' \n \t\t\t\t},\n \t\t\t\t'mystring2': {\n \t\t\t\t\t'message': 'string 2 to translate' \n \t\t\t\t},\n \t\t\t\t'mystring3': {\n \t\t\t\t\t'message': 'string 3 to translate' \n \t\t\t\t},\n \t\t\t\t// include as many strings here as you like...\n \t\t\t\t'somestring': {\n \t\t\t\t\t'message': '...etc...' \n \t\t\t\t}\n \t\t\t},\n \t\t\t// Translation callback function:\n \t\t\tfunction( toLanguage, translatedStrings ) {\n\t\t\t\topera.postError('Translated messages to ' + toLanguage);\n\t\t\t\t// Process resulting translations here...\n\t\t\t\t// e.g. opera.extension.i18n.getMessage('mystring1');\n \t\t\t}\n \t\t);\n \n 4. Use the callback function to obtain the strings translated to the user's locale.\n \t\n \tAlternatively use the standard I18N methods to obtain the translated messages:\n    \n    \topera.extension.i18n.getMessage('mystring1');\n    \topera.extension.i18n.getMessage('somestring');\n    \t// ...etc...\n    \t\n    You can also replace \u003cstring/\u003e placeholders in your messages at runtime as follows:\n\t\n    \topera.extension.i18n.getMessage('somemessage', [ \"string1\", \"string2\" ]);\n    \topera.extension.i18n.getMessage('sign_in_required_message', [ \n    \t    opera.extension.i18n.getMessage('sign_in_message') \n    \t]);\n    \t// etc...\n    \n    \n** NOTE******************************************************************************\n**                                                                                 **\n** IT IS QUICKER TO USE THE FIRST METHOD TO OBTAIN TRANSLATIONS. THE SECOND METHOD **\n** SENDS AN INDIVIDUAL TRANSLATION REQUEST TO THE SERVERS EACH TIME THIS FUNCTION  ** \n** IS CALLED. WHERE POSSIBLE YOU SHOULD PRE-DEFINE YOUR MESSAGES IN messages.js.   **\n**                                                                                 **\n*************************************************************************************\n \n--------\nSupport\n--------\n \n Any problems, questions or feedback please visit: \n \n \thttp://my.opera.com/richtr/blog/experimental-auto-internationalization-i18n-library-for-opera-11-extension-dev\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichtr%2Fopera-11-extensions--auto-i18n-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichtr%2Fopera-11-extensions--auto-i18n-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichtr%2Fopera-11-extensions--auto-i18n-library/lists"}