You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, i18n and l10n is not easy and mature for web applications or sites.
It can cause a lot efforts for both server side and frontend developers.
And still it can be a big challenge .
I would like to suggest cerntain ways to solve this problem generally by browsers.
my suggestions are simple.
HTML part
define i18n resource with tag
it can define:
orignized folders. <i18n url="./i18n"/>
orginized resources like images, strings, etc.
`
the browsers should be able to enumerate how many languages are supported by this application/site or it can be described like this:
<i18n locales=["en", "zh", "fr", "jp"]></i18n>
use resource locally with tag.
it can be used like this:
Hello world!
你好, 世界!
add a tag<i18n> to define i18n resources for the web applications/sites.
JS API part
add i18n and l10n objects
i18n provides apis: i18n.hasLocale
which returns ["en", "zh", "fr", "jp"'] i18n.getLocale
returns a l10n object, null if not supported i18n.setLocale
set new locale for current web application/site
l10n provides apis: l10n.format
formats a string with parameters l10n.get
get an object by an id or an indexable string
Introduction
Currently, i18n and l10n is not easy and mature for web applications or sites.
It can cause a lot efforts for both server side and frontend developers.
And still it can be a big challenge .
I would like to suggest cerntain ways to solve this problem generally by browsers.
my suggestions are simple.
HTML part
define i18n resource with tag
it can define:
orignized folders.
<i18n url="./i18n"/>
orginized resources like images, strings, etc.
`
the browsers should be able to enumerate how many languages are supported by this application/site or it can be described like this:
use resource locally with tag.
it can be used like this:
Hello world! 你好, 世界!
add a tag
<i18n
> to define i18n resources for the web applications/sites.JS API part
i18n
andl10n
objectsi18n
provides apis:i18n
.hasLocale
which returns
["en", "zh", "fr", "jp"']
i18n
.getLocale
returns a
l10n
object,null
if not supportedi18n
.setLocale
set new locale for current web application/site
l10n
provides apis:l10n
.format
formats a string with parameters
l10n
.get
get an object by an id or an indexable string
Browser side
Browsers should be able to fetch all i18n resource indicated by the tags on the first load and every update.
Feedback
The text was updated successfully, but these errors were encountered: