{"id":26085250,"url":"https://github.com/codeplant/mondo","last_synced_at":"2025-10-29T17:40:18.170Z","repository":{"id":6767405,"uuid":"8014143","full_name":"codeplant/mondo","owner":"codeplant","description":"I18n library for node and the browser. Built on top of globalise, cldr, underscore and handlebars. The library provides locale based translations with interpolation and pluralization, parsing and formatting of dates and numbers.","archived":false,"fork":false,"pushed_at":"2023-11-27T21:37:38.000Z","size":449,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-25T22:11:08.943Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeplant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-04T19:10:42.000Z","updated_at":"2021-12-14T19:50:29.000Z","dependencies_parsed_at":"2022-08-17T15:10:18.700Z","dependency_job_id":null,"html_url":"https://github.com/codeplant/mondo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplant%2Fmondo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplant%2Fmondo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplant%2Fmondo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplant%2Fmondo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeplant","download_url":"https://codeload.github.com/codeplant/mondo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242650948,"owners_count":20163611,"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":[],"created_at":"2025-03-09T05:57:58.431Z","updated_at":"2025-10-29T17:40:13.131Z","avatar_url":"https://github.com/codeplant.png","language":"JavaScript","readme":"mondo\n=====\n\nMondo has moved to a new home at codeplant (https://github.com/codeplant/mondo). Our brand new and shiny swiss based company. Visit us on codeplant.ch (http://codeplant.ch)\n\n[![Dependency Status](https://david-dm.org/codeplant/mondo.png)](https://david-dm.org/codeplant/mondo)\n[![Build](https://travis-ci.org/codeplant/mondo.png)](https://travis-ci.org/codeplant/mondo)\n\nmondo is a i18n library for node and the browser. It features date- and number formatting, translations with string interpolation and pluralization.\n\nsee [github issues](https://github.com/codeplant/mondo/issues?milestone=2\u0026state=open) for open task prior version 1.0.0\n\nUnder the hood\n--------------\n\nmondo uses several other libraries under the hood:\n\n*   [globalize](https://github.com/jquery/globalize) - This library does the heavy lifting. globalize provides all the locale information for formatting and parsing.\n\n*   [handlebars](http://handlebarsjs.com) - mondo uses handlebar templates for string interpolation\n\n*   [CLDR.js](https://github.com/jamesarosen/CLDR.js) - provides the pluralization rules. For futher information please refer to the CLDR page on [cldr.unicode.org](http://cldr.unicode.org) \n\n*   [underscorejs](http://underscorejs.org) - No need to introduce this famous citizen of jsworld\n\nSetting current locale\n----------------------\n\n`Mondo.culture('fr-FR')`\n\nFormatting\n----------\n\n`Mondo.format(value, format)` alias: `Mondo.f(value, format)`\n\nFormats the given value according to the format. Please see (https://github.com/jquery/globalize#format) for details and formatting patterns.\n\n`Mondo.date(date)` alias: `Mondo.d(date)`\n\nShortcut for format(date, 'd') uses the short date pattern. e.g. \"dd.MM.yyyy\" for de-CH locale\n\n`Mondo.time(date)` alias: `Mondo.t(date)\n\nShortcut for format(date, 't') uses the short time pattern. e.g. \"\" for de-CH locale\n\nDefining messages for translation\n---------------------------------\n\n### addTranslations(locale, messages)\n\nAdd translation messages to the given locale (culture in globalize speak) definition.\n\n`Mondo.addTranslations('en-US', { title: \"Super awesome webapp\" })`\n\nTo access the title message use:\n\n`Mondo.localize('title')`\n\nNesting messages\n----------------\n\nIt's possible to define nested message for a cleaner message file if lots of messages are used.\n\n`Mondo.addTranslations('en-US', { loginForm: { labels: { username: \"Username\", password: \"Password\"}} })`\n\nTo access nested messages concatenate the single message keys by '.'\n\n`Mondo.localize('loginForm.labels.username')`\n\nDefine pluralizable messages\n-------------------------\n\n`Mondo.addTranslations('en-US', { messageCount: {\n    one: \"message\"\n    other: \"messages\"\n})`\n\nBe aware languages have different rules for pluralization. English as in the above example knows only two different forms. Please refer to [cldr.unicode.org] or [CLDR.js](https://github.com/jamesarosen/CLDR.js) for further information. Allowed pluralization labels are: zero, one, two, few, many, other.\n\nUsing pluralizable messages\n---------------------------\n\nIn addition to the key for the message you need to pass in the pluralization option. Don't include the pluralization label into the message key.\n\n`Mondo.localize('messageCount', { pluralize: 1 })` or `localize('messageCount', { pluralize: 2 });`\n\nAllowed values for the pluralize option are:\n\n* Numbers\n* Every object containing a length attribute or function, like Arrays.\n* Every object containing a size attribute or function.\n* Simple objects. The number of attributes is used.\n\nShortcut if no other options need to be passed:\n\n`Mondo.localize('messageCount', 1)`\n\nDefine interpolation\n------------------------------\n\nHandlebars templates can be used to define interpolatable messages.\n\n`Mondo.addTranslations('de-DE', { loggedInUser: \"Sie sind eingeloggt als {{loginName}}\"});`\n\nUsing interpolation:\n\n`Mondo.localize(\"loggedInUser\", { loginName: \"lchngr\" })`\n\nAll options passed to the localize function passed to the handlebars template except the pluralize option.\n\nHelpers:\n\n* `{{d date}}` Formats the given date as a localized date\n* `{{t time}}` Formats the given date as a localized time\n* `{{p number}}` Formats the given number as percentage. e.g. n=1.23 --\u003e '123%'\n* `{{c amount}}` Formats the given amount as localized currency a=123 --\u003e 'Fr. 123'\n* `{{f value format}}` Formats the given value into the given format string. For details see: [globalize](https://github.com/jquery/globalize)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeplant%2Fmondo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeplant%2Fmondo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeplant%2Fmondo/lists"}