{"id":19777503,"url":"https://github.com/ilib-js/ilib","last_synced_at":"2025-04-05T14:08:51.318Z","repository":{"id":37385038,"uuid":"46331486","full_name":"iLib-js/iLib","owner":"iLib-js","description":"A library of i18n routines written in Javascript.","archived":false,"fork":false,"pushed_at":"2025-03-26T05:29:19.000Z","size":124321,"stargazers_count":33,"open_issues_count":7,"forks_count":4,"subscribers_count":13,"default_branch":"development","last_synced_at":"2025-03-29T13:07:34.974Z","etag":null,"topics":["globalization","i18n","ilib","internationalization","javascript","javascript-library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iLib-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-17T07:53:24.000Z","updated_at":"2025-03-19T05:13:10.000Z","dependencies_parsed_at":"2024-06-18T01:43:36.346Z","dependency_job_id":"0b6b9d37-d4c6-44af-a8f9-77eb21d45263","html_url":"https://github.com/iLib-js/iLib","commit_stats":{"total_commits":3547,"total_committers":23,"mean_commits":154.2173913043478,"dds":0.7076402593741189,"last_synced_commit":"034d4b208d76c9b44e20f817e6032753dc55c16a"},"previous_names":[],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2FiLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2FiLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2FiLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2FiLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iLib-js","download_url":"https://codeload.github.com/iLib-js/iLib/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"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","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":["globalization","i18n","ilib","internationalization","javascript","javascript-library"],"created_at":"2024-11-12T05:25:18.344Z","updated_at":"2025-04-05T14:08:46.307Z","avatar_url":"https://github.com/iLib-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cmeta charset=\"UTF-8\"\u003e\n\niLib\n==== \n\niLib is an internationalization library written in pure ES5 Javascript. It does not require any other libraries to function,\nand can run equally well in various older and newer browsers, on various OS's (including mobile), nodejs, webOS, Qt/QML, \nRingoJS, React/Enact, or rhino/nashorn.\n\nMore elaborate documentation can be found [here](https://ilib-js.github.io/iLib/docs/)\n\nWhat Can iLib Do?\n------\n\niLib contains many classes that cover a large number of i18n topics, a lot more than almost all other JS i18n libraries.\n\n* String translation (ResBundle)\n* String formatting, including plurals/choice formats (IString)\n* Character type functions (like the C/C++ ctype functions) (CType)\n* Calendars (CalendarFactory)\n    * Gregorian, Julian, ThaiSolar, Persian algorithmic, Persian astronomical, Hebrew, Arabic civil, Ethiopic, Coptic, Chinese Han\n* Date and time representation and conversion to other calendars (DateFactory)\n* Date and time formatting in all calendars, including full time zone support (DateFmt)\n* Time zone information from IANA TZ database (TimeZone)\n* Duration formatting for lengths of events, videos, music, etc. (DurationFmt)\n* Date range formatting with specific start and end times (DateRngFmt)\n* Unicode character normalization using the Unicode Normalization Algorithm (NormString)\n    * Also supports full character iteration (as opposed to Unicode character iteration)\n* Unicode glyph string iteration (GlyphString)\n* Number parsing (INumber) and numeric formatting, including percentages and currencies (NumFmt)\n* Units conversion, scaling, and formatting (lengths, volumes, temperature, velocity, etc.) (Measurement and UnitFmt)\n* Phone number parsing and normalization (PhoneNumber), geo-location (PhoneGeoLocator), and formatting (PhoneFmt)\n* Personal name parsing (Name) and formatting (NameFmt)\n* Mailing address parsing (Address) and formatting (AddressFmt)\n* Collation/sorting and sortkey generation (Collator)\n* Locale-sensitive upper- and lower-casing (CaseMapper)\n* Information about writing systems/scripts (ScriptInfo)\n* Information about currencies (Currency)\n* Information about locale settings such as default time zone, default calendar, use of 12 or 24-hour clock, \n* List formatting such as \"Joe, Tom, and Steve\" (ListFormatter)\n* Alphabetic index keeping. For example, it can be used to put names on a contact list into their corresponding\nletter buckets (AlphabeticIndex)\n\nplus a lot more.\n\nOnly need some of that? That's okay, there's a way to make smaller versions of ilib that only include the classes you need\nand only the locales you need using webpack.\n\nWhat Locales Does it Support?\n------\n\nIn short: almost any that you can think of.\n\nFor most classes, it supports all locales that are in the Unicode CLDR (see http://cldr.unicode.org), which means hundreds. \nSince language settings are separate from region settings, the arbitrary combinations of those can reach well\ninto the thousands. For those classes of information where CLDR does not have info yet (such as phone formats), there is a \nmuch smaller set of locales that are supported, but for all classes, the top most used locales on the Internet are represented.\n\nWhere Does it Run?\n-------\n\nILib has been tested in the following environments:\n\n* nodejs 0.10+\n* Browsers:\n    * Chrome 28+\n    * Firefox 35+\n    * Opera 12.16+\n    * Safari 6+\n    * Internet Explorer 8+\n* Rhino on JDK 1.7+ and 1.8 with Trireme (0.8.5)\n* RingoJS 0.11+\n* Qt 5.4+\n\nThose environments have been tested on the following platforms where possible:\n\n* Ubuntu 12.04+\n* Windows 7 \u0026 8\n* Mac OSX 10.04+\n* Android\n* iOS\n\nExample of Using iLib Under NodeJS or RingoJS\n-------\n\niLib is a regular node module and can therefore be loaded using the built-in nodejs require() function.\nHere is an example of using iLib to format the current date/time for Berlin, Germany. This same example\nworks equally well with ringojs running on rhino in a Java-based app server. \n\n~~~~~\nvar DateFactory = require(\"ilib/lib/DateFactory.js\");\nvar DateFmt = require(\"ilib/lib/DateFmt.js\");\n\nvar d = DateFactory();\nvar f = new DateFmt({\n\tlocale: \"de-DE\",\n    type: \"datetime\",\n    length: \"long\",\n    timezone: \"Europe/Berlin\"\n});\n\nf.format(d);\n~~~~~\n\nResult would be:\n\n~~~~~\n'07:45 06. Nov. 2014'\n~~~~~\n\nOther iLib Support\n-------\n\n### Prepackaged iLib\n\nIf you would like to run ilib in your webapp, you can use the pre-webpacked versions of\nilib in the [releases](https://github.com/iLib-js/iLib/releases) page on github.\n\n### Webpack\n\nIf you already use webpack for your own project, you can use the ilib webpack\n[loader](https://github.com/iLib-js/ilib-webpack-loader) and\n[plugin](https://github.com/iLib-js/ilib-webpack-plugin) to include ilib code and locale\ndata into your own webpacked project. The advantage is that\nit will only include those ilib classes you are actually using and only the locale data\nfor the locales you specify. That helps to minimize the file size of your webpack chunks.\nSee the README documentation in the \n[ilib webpack loader](https://github.com/iLib-js/ilib-webpack-loader)\nfor more details.\n\n### No Webpack\n\nIf you do not use webpack for your own project, and yet you still want a minimal version\nof ilib, you can use the [ilib scanner](https://github.com/iLib-js/ilib-scanner) to scan\nyour webapp code and create a webpack config that will build this minimal version for\nyou. You can just include the resulting js files in your webapp. See the README for \nthat project for details.\n\n### React\n\nIf you are using React in your project and would like to include ilib classes, you can\nuse the webpack loader and plugin mentioned above to do so.\n\nAdditionally, there is a new library of React components called [react-ilib](https://github.com/iLib-js/react-ilib)\nthat will eventually allow you to use all the ilib formatters as React components, such as an\naddress formatting component that will output an address in the correct format per locale.\nIt says \"eventually\" in the previous sentence because the project is new and there is\na lot left to code.\n\nReact-ilib will also include a number of new components\nthat allow you to do localized input form elements. For example, a localized address\nform component will present all of the fields necessary for an address in a number of\ndifferent locales, along with the localized field labels and placeholder texts. The\nresult of a user filling out the form would be an ilib Address instance, ready to use!\n\n### ES6\n\nIf you want to use ilib classes directly from ES6 instead of using React components, you \ncan do that with the [ilib-es6](https://github.com/iLib-js/ilib-es6) project. With this\nlibrary, you can use ilib asynchronously with promises instead of node-style callbacks,\nand you can import the classes in regular ES6 style. This library also works nicely in\nReact if you want to call the ilib classes directly instead of using react-ilib\ncomponents.\n\n### Localizing Your Strings\n\nIf you use ilib in your javascript project, you can use the [loctool](https://github.com/iLib-js/loctool)\nto extract the strings into XLIFF files that your translation vendor can translate\ndirectly. When you received the localized XLIFF files back again, you can then run\nthe loctool again to generate localized assets, such as resource files that ilib's\nResBundle class can use, or copies of HTML files with localized text in them. See the\nloctool documentation for more information.\n\nWhere to Get it\n-------\n\nFor node, you can simply install it using npm or yarn:\n\n~~~~~\nnpm install ilib\nyarn add ilib\n~~~~~\n\nFor ringojs, you can install it with the ringo package manager:\n\n~~~~~\nrp install ilib\n~~~~~\n\nILib is also available on github at https://github.com/iLib-js/iLib\nor official iLib builds in tar balls at https://github.com/iLib-js/iLib/releases\n\nYou can also build your own version from the sources using webpack. See the previous\nsection about webpack for links.\n\nCopyright and License\n-------\n\nCopyright (c) 2011-2024, JEDLSoft\n\nIlib is licensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this library except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nMore Documentation\n------\n\nMore elaborate documentation can be found [here](https://ilib-js.github.io/iLib/docs/).\n\nOther Information\n------\n\nPlease point your browser to the following places to get more documentation:\n\n- JSDocs: https://ilib-js.github.io/iLib/docs/api/jsdoc/index.html\n- Github: git clone git@github.com:iLib-js/iLib.git\n- Builds: https://github.com/iLib-js/iLib/releases\n- Wiki: https://github.com/iLib-js/iLib/wiki\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filib-js%2Filib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib/lists"}