diff --git a/Tools/nib2cib/NSCustomResource.j b/Tools/nib2cib/NSCustomResource.j index f19805662..090c3d07e 100644 --- a/Tools/nib2cib/NSCustomResource.j +++ b/Tools/nib2cib/NSCustomResource.j @@ -73,11 +73,11 @@ var FILE = require("file"), } // Account for the fact that an extension may have been inferred. - if (resourceInfo && - resourceInfo.path && - FILE.extension(resourceInfo.path) !== FILE.extension(_resourceName)) + if (resourceInfo && resourceInfo.path) { - _resourceName += FILE.extension(resourceInfo.path); + // Include subdirectories in the name + match = /^.+\/Resources\/(.+)$/.exec(resourceInfo.path) + _resourceName = match[1]; } } @@ -100,7 +100,7 @@ var FILE = require("file"), resourceInfo ? FILE.canonical(resourceInfo.path) : "", size.width, size.height); - } + } return self; } diff --git a/Tools/nib2cib/Nib2Cib.j b/Tools/nib2cib/Nib2Cib.j index fbe1fa765..868a02557 100644 --- a/Tools/nib2cib/Nib2Cib.j +++ b/Tools/nib2cib/Nib2Cib.j @@ -554,12 +554,13 @@ var FILE = require("file"), { appDirectory = @""; - var parentDir = FILE.dirname(aPath); + var parentDir = FILE.dirname(aPath), + match = /^(.+)(\/Resources(?:\/.+)?)$/.exec(parentDir); - if (FILE.basename(parentDir) === "Resources") + if (match) { - appDirectory = FILE.dirname(parentDir); - appResourceDirectory = parentDir; + appDirectory = match[1]; + appResourceDirectory = FILE.join(appDirectory, "Resources"); } else {