👋
👶🏽 ❤️ 🤓 📝 🏡
🇲🇽🇳🇮🇺🇸🇨🇳🇬🇧
🤔
A number-based word
🤔
https://w3techs.com/technologies/overview/content_language/all
http://www.internetworldstats.com/stats7.htm
If you internationalise, you design or develop your content, application, specification, and so on, in a way that ensures it will work well for, or can be easily adapted for, users from any culture, region, or language.
W3C Standards
🕯🕯🕯🕯🕯
🕯🕯🕯🕯🕯
🕯🕯🕯🕯🕯
A standard for consistent encoding, representation, and handling of text expressed in most of the world's writing systems.
This includes all world languages and emoji! 🙌
Includes various encodings, most used is UTF-8, the most widely used by websites. 1-4 bytes.
Solves the writing system consideration!
☕️
咖啡
قهوة
coffee
🕯🕯🕯🕯🕯
[Language Tag]-[Subtags]*
👶🏽 ❤️ 🤓 📝 🏡
🇲🇽🇳🇮🇺🇸🇨🇳🇬🇧
es_MX es_NI en_US zh_Hans_CN en_UK
es_419
🕯🕯🕯🕯🕯
Provides key building blocks for software to support the world's languages, with the largest and most extensive standard repository of locale data available.
<days>
<dayContext type="format">
<dayWidth type="abbreviated">
<day type="sun">dom.</day>
<day type="mon">lun.</day>
<day type="tue">mar.</day>
<day type="wed">mié.</day>
<day type="thu">jue.</day>
<day type="fri">vie.</day>
<day type="sat">sáb.</day>
</dayWidth>
<dayWidth type="short">
<day type="sun">DO</day>
<day type="mon">LU</day>
<day type="tue">MA</day>
<day type="wed">MI</day>
<day type="thu">JU</day>
<day type="fri">VI</day>
<day type="sat">SA</day>
</dayWidth>
<dayWidth type="wide">
<day type="sun">domingo</day>
<day type="mon">lunes</day>
<day type="tue">martes</day>
<day type="wed">miércoles</day>
<day type="thu">jueves</day>
<day type="fri">viernes</day>
<day type="sat">sábado</day>
</dayWidth>
</dayContext>
</days>
CLDR 'Days' Section for Spanish Language
🕯🕯🕯🕯🕯
set of C/C++ and Java libraries providing Unicode and Globalization support for software applications
defines
Stores variable data between { curly braces }
🕯🕯🕯🕯🕯
@elibelly
ECMA 402
Intl.NumberFormat
Intl.DateTimeFormat
Intl.Collator
var myNumber = 123456.789;
// the Japanese yen doesn't use a minor unit
console.log(
new Intl.NumberFormat('ja-JP',
{ style: 'currency',
currency: 'JPY' })
.format(myNumber)
)
// → ¥123,457
// request a weekday along with a long date
var options = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric' };
console.log(
new Intl.DateTimeFormat('de-DE', options).format(date)
);
// → "Donnerstag, 20. Dezember 2012"
🕯🕯🕯🕯🕯
🕯🕯🕯🕯🕯
🕯🕯🕯🕯🕯
Config
addLocaleData
intlShape
injectIntl
defineMessages
Wrapper: IntlProvider
FormattedDate
FormattedTime
FormattedRelative
FormattedNumber
FormattedPlural
FormattedMessage
import { IntlProvider, addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import ru from 'react-intl/locale-data/ru';
import es from 'react-intl/locale-data/es';
import fr from 'react-intl/locale-data/fr';
addLocaleData([...en, ...fr, ...es, ...ru]);
If on the client side, each extra locale (usually language) is loaded in as a separate bundle
On the node all locales are loaded into memory server-side
import { IntlProvider, addLocaleData } from 'react-intl';
...
// This should be the only place where you update the locale
const locale = 'es-419';
const messages = require(`./locales/${locale}.json`);
ReactDOM.render(
<IntlProvider locale={locale} messages={messages}>
<App />
</IntlProvider>,
document.getElementById('root')
);
// es-419.json
{
"nameInput.placeholder": "Por favor introduzca su nombre...",
"app.header": "Ejemplos de React Intl",
"app.welcome_message":
"{gender, select,
female {Bienvenida}
male {Bienvenido}
other {Bienvenidx}} {name}, {unreadCount, plural,
=0 {no tienes messages}
one {tienes {formattedUnreadCount} mensaje nuevo}
other {tienes {formattedUnreadCount} mensajes nuevos}} desde {formattedLastLoginTime}.",
"app.currentTime": "Hora actual: ",
"app.you": "tú"
}
<FormattedNumber value={unreadCount} /> // 1,234 vs 1.234
<FormattedMessage id="app.login_screen.header" defaultMessage="This is a Header" />
<FormattedTime value={Date.now()} timeZoneName="long" />
<FormattedMessage
id="app.welcome_message"
defaultMessage={`
Welcome {name}, you have received {unreadCount, plural,
=0 {no new messages}
one {{formattedUnreadCount} new message}
other {{formattedUnreadCount} new messages}
} since {formattedLastLoginTime}.
`}
values={{
name: (
<b>
{this.state.name || (
<FormattedMessage id="app.you" defaultMessage="you" />
)}
</b>
),
unreadCount: unreadCount,
formattedUnreadCount,
formattedLastLoginTime,
gender,
}}
/>
🎉
🕯🕯🕯
🕯 Locale Detection
🕯 Performance
🕯 Continuous Localisation
import {
IntlProvider,
addLocaleData
} from 'react-intl';
...
// This should be the only place
// where you update the locale
const locale = 'es-419';
It is a way of automatically, seamlessly gathering new source material, publishing it for translation, acquiring translations and integrating them back into the product.
💡
🕯🕯🕯
👋