0

I am working on website internalization and it has YUI3 in stack, so it is good to use YUI intl module for that. Reading documentation gave idea to leverage shifter builder to convert Java property i18n files into YUI3 intl format (think as YRB(.pres) as they both have same syntax. Going from that I created meta module/meta/module.json file looking like this:

{
  "modulename": {
    "requires": [
        "oop"
    ]
},
"lang": ["en"]
}

And accordingly placed the language file like module/lang/modulename_en.pres.

That's not worked out, build processing successfully but no lang folders with context created. Also I tried use json like javascript version with no luck. I guess missing some additional step.

UPD: Thank you for comments. There is wrong syntax in my meta, the lang property has to be on the same level as requires that fixed problem with finding language files but still there is error when trying to use .pres files. Here it is the output:

....
shifter [info] shifting 2 langs for module

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'c:\\..\module\lang\module.js'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.openSync (c:\Program Files\nodejs\node_modules\shifter\node_mod
ules\cpr\node_modules\graceful-fs\graceful-fs.js:68:26)
    at Object.fs.readFileSync (fs.js:284:15)
    at c:\Program Files\nodejs\node_modules\shifter\lib\module.js:424:26
    at Array.forEach (native)
    at Object.buildLang [as lang] (c:\Program Files\nodejs\node_modules\shifter\
lib\module.js:417:11)
    at c:\Program Files\nodejs\node_modules\shifter\lib\module.js:709:33
    at c:\Program Files\nodejs\node_modules\shifter\lib\stack.js:24:38
    at c:\Program Files\nodejs\node_modules\shifter\lib\module.js:372:13
    at c:\Program Files\nodejs\node_modules\shifter\node_modules\gear\node_modul
es\async\lib\async.js:190:13

I also opened report into shifter github repo. Will try to debug and see what I am missing here.

dmi3y
  • 3,482
  • 2
  • 21
  • 32
  • Also asked in: https://github.com/yui/shifter/issues/94 – user32225 Aug 16 '13 at 05:08
  • 1
    The `lang` property in the sample json file above should be nested at the same level as the `requires`, but I assume that might be a copying error. – user32225 Aug 16 '13 at 05:11
  • Meta file is good, I probably had some name inconsistences, anyway I have now lang modules generated from .js but have error when trying use .pres. Still exploring. – dmi3y Aug 16 '13 at 05:21
  • Oh, yes you was right about nesting, that's was a blocker (no errors by the way), but still trying to make .pres run around. – dmi3y Aug 16 '13 at 05:34
  • Clearly, shifter expects only .js files: https://github.com/yui/shifter/blob/master/lib/module.js#L423 – user32225 Aug 17 '13 at 07:02

1 Answers1

0

Seems like intl module documentation is referring for some other internal version of shifter other than git one, or possibly that functionality is on its way. Nevertheles I needed that functionality and there is what works so far.

UPD: Thanks for comment I did glimpse to pre shifter era builder, and find out yrb2json parser here in already javascript format. Seems I am only the one person for these years who was interested in this functionality into nodejs shifter.

dmi3y
  • 3,482
  • 2
  • 21
  • 32
  • 1
    Initially YUI was built using an ant-based built system. Shifter came after that user guide was written. The earlier built system probably handled the .pres files while shifter never got to do that. – user32225 Aug 20 '13 at 06:21