Closed Bug 1131515 Opened 10 years ago Closed 10 years ago

Running multilocale.js on node.js

Categories

(Firefox OS Graveyard :: Gaia::Build, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rickychien, Assigned: gduan)

References

Details

Attachments

(2 files)

No description provided.
Assignee: nobody → gduan
Comment on attachment 8576423 [details] [review] [gaia] cctuan:1131515 > mozilla-b2g:master Hi Ricky, I've checked diffs between node/xpc HEAD/HEAD^1 with PRODUCTION=1 and it looks good. I did some workarounds due to old version of jsdom-nogyp: 1. document.head => document.querySelector('head') 2. jsdom.jsdom(content) => jsdom.jsdom(content, jsdom.level(3, 'core')) 3. define Setter for outerHTML
Attachment #8576423 - Flags: review?(ricky060709)
Comment on attachment 8576423 [details] [review] [gaia] cctuan:1131515 > mozilla-b2g:master I found some of these diff results are different compared between xpcshell/node version. Such as < <input id="modal-dialog-prompt-input"> --- > <input id="modal-dialog-prompt-input" type="text"> or < <!DOCTYPE html> --- > <!DOCTYPE HTML> ... However, it's fine since I guess there is a different DOM parsing mechanism using in jsdom.
Attachment #8576423 - Flags: review?(ricky060709) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
The interesting part is , when build goes with new patch under node, command like below make LOCALES_FILE=build/test/resources/locales/languages.json LOCALE_BASEDIR=build/test/resources/locales will generate all translated zh-CN.json but xpc doesn't. XPC only generate partial translated zh-CN.json. I believe the result from node should be correct.
Comment on attachment 8576544 [details] [review] [gaia] cctuan:1131515 > mozilla-b2g:master Hi Ricky, pb fixed, and tbpl passed. please kindly check. issues are as below, 1. filter for utils.ls will check full path of each file, so we should consider put scanning target's file path to do the filter. 2. some ES6 fixed for node env
Attachment #8576544 - Flags: review?(ricky060709)
Comment on attachment 8576544 [details] [review] [gaia] cctuan:1131515 > mozilla-b2g:master Finally we found that root cause of Gb failure. PR looks fine to me, r=me. Some of nits have been leaved on Github, please fix it before landing.
Attachment #8576544 - Flags: review?(ricky060709) → review+
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Hey George, it seems that your patch regressed multilocale - bug 1147332. From my initial analysis, you can easily reproduce it doing: APP=system make profile LOCALES_FILE=./locales/languages_my.json LOCALE_BASEDIR=../gaia-l10n/master/ The source of the problem is that this line: var resFile = utils.getFile(utils.joinPath.apply(null, paths)); does not work. In particular, "utils.joinPath.apply(null, paths)" does not concatenate the array of strings into a single path string. For example, this array: [/Volumes/projects/gaia/apps/system,/fxa,locales/fxa.en-US.properties] Results in: "/fxa/locales/fxa.en-US.properties" instead of "/Volumes/projects/gaia/apps/system/fxa/locales/fxa.en-US.properties". Reverting this change to "var resFile = utils.getFile.apply(null, paths);" solves the problem. Do you want to backout your patch or can you work on a follow up?
Blocks: 1147332
Flags: needinfo?(gduan)
Thanks Zibi, I've created a patch in bug 1147332, could you please help to check if it could solve this issue? Thanks. https://github.com/mozilla-b2g/gaia/pull/29159
Flags: needinfo?(gduan) → needinfo?(gandalf)
Flags: needinfo?(gandalf)
Priority: -- → P1
Summary: Running multilocale.js and l10n.js on node.js → Running multilocale.js on node.js
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: