Re: ISSUE-80: Runtime localization model for widgets [Widgets]

I am all in favor of *not* having to replicate many files in the widget
distribution just so you can create localized versions of a single image.

One more thing I'll add. One of the URL techniques in the Widgets spec,
using "/" as the first character in a relative address, works OK in widget
workflows where the content is always wrapped in a ZIP, but in various Web
Widget workflows, the widget contents are often exploded into a file system
where the root of the widget is not the root of the file system or the root
of the Web site. In those scenarios, you can't use "/" as the first
character in a relative address, which means the entire set of files would
have to be duplicated for each locale. Hardly ideal.


             Web Applications                                              
             Working Group                                                 
             Issue Tracker                                              To 
   >                                           cc 
             Sent by:                                                      
             public-webapps-re                                     Subject 
                 ISSUE-80: Runtime localization      
                                       model for widgets [Widgets]         
             02/02/2009 03:51                                              
             Please respond to                                             
             Web Applications                                              
             Working Group WG                                              

ISSUE-80: Runtime localization model for widgets [Widgets]

Raised by: Josh Soref
On product: Widgets

Below is a discussion I had with Josh about the localization model for
widgets. Josh identifies an issue that may affect localization at
runtime that may be overcome by having the widget engines dynamically
change folders when it can't find resources.  how do localized folders work anyway?
 Sent at 12:01 AM on Sunday  oh, it's hidden in <base folder>
 me:  you put folders that follow the "lang-place" pattern into a
folder called "locale". The UA looks for a folder that matches the
user's locale prefs  i'm not quite sure i understand or like that
imagine i have 100 images
and only want to localize 2
if base-folder means that i have to copy the whole set, i'm unhappy
 me:  no, just make all your refs absolute. it's no problem  no, definitely bad
that means i have to know in advance if i need to localize a path
instead of just having 1 locale that needs to localize a file
 me:  yes. But it supports multiple models of localization. So the
model is quite flexible.  supporting a virtual mapping would have
been better :(
 me:  we can always change it if you have a better proposal  i guess the simplest question is would you
ever have a localized file and want access to the original
unlocalized file  i claim no
 me:  no, you wouldn't
the idea is that you only localize what you want.  yeah
so, in my model, instead of 'base folder'
a localized file i18n/en-GB/index.html appears as /index.html if the
UA selects en-GB
 me:  I'm sure we are thinking of the same thing here, but now I'm
worried I've done this wrong.  (so searches go first to i18n/en-GB/ and then
to /)
if index.html has <img src="flag.png">
 me:  flag.png gets resolved to  i18n/en-GB/flag.png  then whether it's /index.html, or
/i18n/fr-FR/index.html if the UA locale is fr-FR, it first looks in
/i18n/fr-FR/flag.png and then /flag.png
yeah, but that's not what i want
it's a disaster
 me:  no, it only goes to one location  yeah, that sucks.
you end up w/ millions of included files in dozens of locales
because only one needed an override
or you have to fork each html file just to make something happy
 me:  hmmm
I'm not convinced... I thought I had sorted this out
I need to do some tests  we have a VFS, and our UA has a cache,
which means having it try two paths won't hurt
(and it's a readonly VFS, so if  i do <img src="images/flag.png"> and
my locale doesn't have /i18n/fr-FR/images/, then the UA can skip the
check for the file there and go straight to /images/flag.png
 Sent at 12:12 AM on Sunday  basically, when people try to localize,
they often end up forking html files. and often they create stale
versions w/o noticing
 me:  I kinda get where you are going, but it seems like the behavior
is kinda unpredictable. I'm kinda seeing the problem now.  it's fairly easy to make a tool to show
which version of a file would be used
 me:  does it matter that you dont need to have a html file in the
localized folders?
that way you only need to branch when you need a special layout  if all i have is /index.html and it has
<img src="flag.png"> then it should search /i18n/fr-FR/flag.png then
having to branch html files is dangerous
 me:  ah!
/me gets it now :)  note that i switched from en-GB to fr-FR as my
 me:  ok, that should be easy to specify.
it's just a minor extension to what we already have
kinda fallback behavior

Received on Thursday, 5 February 2009 06:44:43 UTC