I noticed that I can insert another language into the webfm.js file. I just have two questions.

1). I have Chinese and English on my site. Is it possible for me to create another webfm.js file (webfmchinese.js for example) and then call it depending on what category my users are browsing? For example, if I have my site divided into a English and Chinese category, would it be possible for me to call one or the other .js files depending on which category...?

2). I am having trouble with the Chinese characters...can I use Chinese with javascript? Do I need to make any special changes to the coding?

Thanks a lot!

CommentFileSizeAuthor
#4 403642-4_translate_js.patch9.7 KBpasqualle

Comments

castawaybcn’s picture

I would also like to translate the strings embeded in the .js file of the module (in a multilanguage site), did you find a solution?

robmilne’s picture

I'll be applying the Drupal.t() function to my js strings in the next rev so that proper translation will be possible.

castawaybcn’s picture

excellent news!!

pasqualle’s picture

Version: 6.x-2.9-alpha2 » 6.x-2.10-rc4
Category: support » feature
Status: Active » Needs review
StatusFileSize
new9.7 KB

patch for HEAD..
The patch is not perfect as sentences should not be divided into smaller pieces.

for example this:

if(Webfm.confirm(Webfm.js_msg["confirm-del0"] + (obj.is_file ? Webfm.js_msg["file"] : Webfm.js_msg["dir"]) + " " + path + (obj.is_file ? "" : Webfm.js_msg["confirm-del1"]) + "?")) {
...

should be something like:

var message = obj.is_file ?
  Drupal.t('Do you want to delete the @file?', {'@file': Webfm.js_msg["file"] + " " + path}) :
  Drupal.t('Do you want to delete the @directory and all its contents?', {'@directory': Webfm.js_msg["dir"] + " " + path});

  if(Webfm.confirm(message)) {
 ...
robmilne’s picture

Thanks - I'll review this carefully before making any changes (I'm totally swamped and my promised 'next rev' is not on the horizon yet)

-rob

robmilne’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.