summaryrefslogtreecommitdiffstats
path: root/tools/grit
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-18 00:29:56 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-18 00:29:56 +0000
commite4844e11f1f5a9ee8707b1f6f79aa3de54db2248 (patch)
treeb9fbe2fa44b3c3788c48ce7f2608519f089dfc75 /tools/grit
parent2996fcdd802f1fbe7531d8e67a7cd3daa805396e (diff)
downloadchromium_src-e4844e11f1f5a9ee8707b1f6f79aa3de54db2248.zip
chromium_src-e4844e11f1f5a9ee8707b1f6f79aa3de54db2248.tar.gz
chromium_src-e4844e11f1f5a9ee8707b1f6f79aa3de54db2248.tar.bz2
step 1 on getting strings in linux: create a locale_settings.grd
based on locale_settings_en-US.rc. We don't use this anywhere yet, just putting things in place. - Fix preprocessor defines in grit vcproj files (needs to be defined everywhere) and update grit_localized_resources.rules to pass the preprocessor define to grit. - Add generated .h files to chrome_strings.vcproj so people can ctrl+alt+a open them. - Update GRIT so it knows how to substitute [GRITLANGCODE] in strings to the locale value. Review URL: http://codereview.chromium.org/20440 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rw-r--r--tools/grit/build/grit_localized_resources.rules10
-rw-r--r--tools/grit/grit/node/message.py9
2 files changed, 14 insertions, 5 deletions
diff --git a/tools/grit/build/grit_localized_resources.rules b/tools/grit/build/grit_localized_resources.rules
index 9c3a53b..ca48791 100644
--- a/tools/grit/build/grit_localized_resources.rules
+++ b/tools/grit/build/grit_localized_resources.rules
@@ -7,7 +7,7 @@
<CustomBuildRule
Name="GRIT Generated Localized Resources"
DisplayName="GRIT Generated Localized Resources"
- CommandLine="$(SolutionDir)..\tools\grit\build\grit_resource_file.bat [inputs] &quot;$(SolutionDir)&quot; &quot;$(OutDir)\grit_derived_sources&quot;"
+ CommandLine="$(SolutionDir)..\tools\grit\build\grit_resource_file.bat [inputs] &quot;$(SolutionDir)&quot; &quot;$(OutDir)\grit_derived_sources&quot; [AllOptions]"
Outputs="$(OutDir)\grit_derived_sources\$(InputName).h;
$(OutDir)\grit_derived_sources\$(InputName)_ar.rc;
$(OutDir)\grit_derived_sources\$(InputName)_bg.rc;
@@ -113,6 +113,14 @@
ExecutionDescription="Generating resources..."
>
<Properties>
+ <StringProperty
+ Name="PreprocessorDefinitions"
+ DisplayName="Preprocessor Definitions"
+ Description="Defines a text macro with the given name."
+ Switch="&quot;[value]&quot;"
+ Delimited="true"
+ Inheritable="true"
+ />
</Properties>
</CustomBuildRule>
</Rules>
diff --git a/tools/grit/grit/node/message.py b/tools/grit/grit/node/message.py
index 5ae1162..449238b 100644
--- a/tools/grit/grit/node/message.py
+++ b/tools/grit/grit/node/message.py
@@ -163,10 +163,11 @@ class MessageNode(base.ContentNode):
'''Returns a translated version of this message.
'''
assert self.clique
- return self.clique.MessageForLanguage(lang,
- self.PseudoIsAllowed(),
- self.ShouldFallbackToEnglish()
- ).GetRealContent()
+ msg = self.clique.MessageForLanguage(lang,
+ self.PseudoIsAllowed(),
+ self.ShouldFallbackToEnglish()
+ ).GetRealContent()
+ return msg.replace('[GRITLANGCODE]', lang)
def NameOrOffset(self):
if 'name' in self.attrs: