summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 06:37:13 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-19 06:37:13 +0000
commitaf7baa16383a62872d57219cfdca27caca4dd6a7 (patch)
tree86619134033f1ad511d75654a84a0f9d1170194d /app
parentf2c444980e5e4aac875b96cb911b0d347f3d81c5 (diff)
downloadchromium_src-af7baa16383a62872d57219cfdca27caca4dd6a7.zip
chromium_src-af7baa16383a62872d57219cfdca27caca4dd6a7.tar.gz
chromium_src-af7baa16383a62872d57219cfdca27caca4dd6a7.tar.bz2
Create a new app_strings target that builds strings for the app_base and eventually views targets.
http://crbug.com/11387 Review URL: http://codereview.chromium.org/113565 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/DEPS2
-rw-r--r--app/app.gyp40
-rw-r--r--app/gfx/font_win.cc1
-rw-r--r--app/os_exchange_data_win.cc4
-rw-r--r--app/resources/app_strings.grd195
-rw-r--r--app/win_util.cc4
6 files changed, 239 insertions, 7 deletions
diff --git a/app/DEPS b/app/DEPS
index da89e8e..263d2cb 100644
--- a/app/DEPS
+++ b/app/DEPS
@@ -1,6 +1,6 @@
include_rules = [
+ "+grit/app_strings.h",
# TODO(beng): swap these with app/views specific generated resources.
- "+grit/generated_resources.h",
"+grit/locale_settings.h",
"+grit/theme_resources.h",
"+net",
diff --git a/app/app.gyp b/app/app.gyp
index 06c954a..71efee1 100644
--- a/app/app.gyp
+++ b/app/app.gyp
@@ -42,6 +42,7 @@
'type': '<(library)',
'msvs_guid': '4631946D-7D5F-44BD-A5A8-504C0A7033BE',
'dependencies': [
+ 'app_strings',
'../base/base.gyp:base',
'../base/base.gyp:base_gfx',
'../net/net.gyp:net',
@@ -164,7 +165,7 @@
'type': 'executable',
'msvs_guid': 'B4D59AE8-8D2F-97E1-A8E9-6D2826729530',
'dependencies': [
- '../app/app.gyp:app_base',
+ 'app_base',
'../net/net.gyp:net_test_support',
'../skia/skia.gyp:skia',
'../testing/gtest.gyp:gtest',
@@ -207,5 +208,42 @@
}],
],
},
+ {
+ 'target_name': 'app_strings',
+ 'type': 'none',
+ 'msvs_guid': 'AE9BF4A2-19C5-49D8-BB1A-F28496DD7051',
+ 'variables': {
+ 'grit_path': '../tools/grit/grit.py',
+ 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/app',
+ },
+ 'actions': [
+ {
+ 'action_name': 'app_strings',
+ 'variables': {
+ 'input_path': 'resources/app_strings.grd',
+ },
+ 'inputs': [
+ '<(input_path)',
+ ],
+ 'outputs': [
+ '<(grit_out_dir)/grit/app_strings.h',
+ '<(grit_out_dir)/app_strings_en-US.pak',
+ '<(grit_out_dir)/app_strings_en-US.rc',
+ ],
+ 'action': ['python', '<(grit_path)', '-i', '<(input_path)', 'build', '-o', '<(grit_out_dir)'],
+ 'message': 'Generating resources from <(input_path)',
+ },
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(SHARED_INTERMEDIATE_DIR)/app',
+ ],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'dependencies': ['../build/win/system.gyp:cygwin'],
+ }],
+ ],
+ },
],
}
diff --git a/app/gfx/font_win.cc b/app/gfx/font_win.cc
index 7323e9c..c1b9d24 100644
--- a/app/gfx/font_win.cc
+++ b/app/gfx/font_win.cc
@@ -12,7 +12,6 @@
#include "app/l10n_util_win.h"
#include "base/logging.h"
#include "base/win_util.h"
-#include "grit/generated_resources.h"
namespace gfx {
diff --git a/app/os_exchange_data_win.cc b/app/os_exchange_data_win.cc
index e27c6fd..c7bd18b 100644
--- a/app/os_exchange_data_win.cc
+++ b/app/os_exchange_data_win.cc
@@ -13,7 +13,7 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
-#include "grit/generated_resources.h"
+#include "grit/app_strings.h"
#include "net/base/net_util.h"
// Creates a new STGMEDIUM object to hold the specified text. The caller
@@ -668,7 +668,7 @@ static void CreateValidFileNameFromTitle(const GURL& url,
url, std::string(), std::string(), std::wstring());
} else {
// Nothing else can be done, just use a default.
- *validated = l10n_util::GetString(IDS_UNTITLED_SHORTCUT_FILE_NAME);
+ *validated = l10n_util::GetString(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME);
}
} else {
*validated = title;
diff --git a/app/resources/app_strings.grd b/app/resources/app_strings.grd
new file mode 100644
index 0000000..96fb59f
--- /dev/null
+++ b/app/resources/app_strings.grd
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- This file contains definitions of resources that will be translated for
+each locale. Specifically, these are UI strings that are used by app/ that
+need to be translated for each locale.-->
+
+<grit base_dir="." latest_public_release="0" current_release="1"
+ source_lang_id="en" enc_check="möl">
+ <outputs>
+ <!-- TODO add each of your output files. Modify the three below, and add
+ your own for your various languages. See the user's guide
+ (http://wiki/Main/GritUsersGuide) for more details.
+ Note that all output references are relative to the output directory
+ which is specified at build time. -->
+ <output filename="grit/app_strings.h" type="rc_header">
+ <emit emit_type='prepend'></emit>
+ </output>
+ <output filename="app_strings_ar.rc" type="rc_all" lang="ar" />
+ <output filename="app_strings_bg.rc" type="rc_all" lang="bg" />
+ <output filename="app_strings_bn.rc" type="rc_all" lang="bn" />
+ <output filename="app_strings_ca.rc" type="rc_all" lang="ca" />
+ <output filename="app_strings_cs.rc" type="rc_all" lang="cs" />
+ <output filename="app_strings_da.rc" type="rc_all" lang="da" />
+ <output filename="app_strings_de.rc" type="rc_all" lang="de" />
+ <output filename="app_strings_el.rc" type="rc_all" lang="el" />
+ <output filename="app_strings_en-GB.rc" type="rc_all" lang="en-GB" />
+ <output filename="app_strings_en-US.rc" type="rc_all" lang="en" />
+ <output filename="app_strings_es.rc" type="rc_all" lang="es" />
+ <output filename="app_strings_es-419.rc" type="rc_all" lang="es-419" />
+ <output filename="app_strings_et.rc" type="rc_all" lang="et" />
+ <output filename="app_strings_fi.rc" type="rc_all" lang="fi" />
+ <output filename="app_strings_fil.rc" type="rc_all" lang="fil" />
+ <output filename="app_strings_fr.rc" type="rc_all" lang="fr" />
+ <output filename="app_strings_gu.rc" type="rc_all" lang="gu" />
+ <output filename="app_strings_he.rc" type="rc_all" lang="he" />
+ <output filename="app_strings_hi.rc" type="rc_all" lang="hi" />
+ <output filename="app_strings_hr.rc" type="rc_all" lang="hr" />
+ <output filename="app_strings_hu.rc" type="rc_all" lang="hu" />
+ <output filename="app_strings_id.rc" type="rc_all" lang="id" />
+ <output filename="app_strings_it.rc" type="rc_all" lang="it" />
+ <output filename="app_strings_ja.rc" type="rc_all" lang="ja" />
+ <output filename="app_strings_kn.rc" type="rc_all" lang="kn" />
+ <output filename="app_strings_ko.rc" type="rc_all" lang="ko" />
+ <output filename="app_strings_lt.rc" type="rc_all" lang="lt" />
+ <output filename="app_strings_lv.rc" type="rc_all" lang="lv" />
+ <output filename="app_strings_ml.rc" type="rc_all" lang="ml" />
+ <output filename="app_strings_mr.rc" type="rc_all" lang="mr" />
+ <output filename="app_strings_nl.rc" type="rc_all" lang="nl" />
+ <!-- The translation console uses 'no' for Norwegian Bokmål. It should
+ be 'nb'. -->
+ <output filename="app_strings_nb.rc" type="rc_all" lang="no" />
+ <output filename="app_strings_or.rc" type="rc_all" lang="or" />
+ <output filename="app_strings_pl.rc" type="rc_all" lang="pl" />
+ <output filename="app_strings_pt-BR.rc" type="rc_all" lang="pt-BR" />
+ <output filename="app_strings_pt-PT.rc" type="rc_all" lang="pt-PT" />
+ <output filename="app_strings_ro.rc" type="rc_all" lang="ro" />
+ <output filename="app_strings_ru.rc" type="rc_all" lang="ru" />
+ <output filename="app_strings_sk.rc" type="rc_all" lang="sk" />
+ <output filename="app_strings_sl.rc" type="rc_all" lang="sl" />
+ <output filename="app_strings_sr.rc" type="rc_all" lang="sr" />
+ <output filename="app_strings_sv.rc" type="rc_all" lang="sv" />
+ <output filename="app_strings_ta.rc" type="rc_all" lang="ta" />
+ <output filename="app_strings_te.rc" type="rc_all" lang="te" />
+ <output filename="app_strings_th.rc" type="rc_all" lang="th" />
+ <output filename="app_strings_tr.rc" type="rc_all" lang="tr" />
+ <output filename="app_strings_uk.rc" type="rc_all" lang="uk" />
+ <output filename="app_strings_vi.rc" type="rc_all" lang="vi" />
+ <output filename="app_strings_zh-CN.rc" type="rc_all" lang="zh-CN" />
+ <output filename="app_strings_zh-TW.rc" type="rc_all" lang="zh-TW" />
+
+ <output filename="app_strings_ar.pak" type="data_package" lang="ar" />
+ <output filename="app_strings_bg.pak" type="data_package" lang="bg" />
+ <output filename="app_strings_bn.pak" type="data_package" lang="bn" />
+ <output filename="app_strings_ca.pak" type="data_package" lang="ca" />
+ <output filename="app_strings_cs.pak" type="data_package" lang="cs" />
+ <output filename="app_strings_da.pak" type="data_package" lang="da" />
+ <output filename="app_strings_de.pak" type="data_package" lang="de" />
+ <output filename="app_strings_el.pak" type="data_package" lang="el" />
+ <output filename="app_strings_en-GB.pak" type="data_package" lang="en-GB" />
+ <output filename="app_strings_en-US.pak" type="data_package" lang="en" />
+ <output filename="app_strings_es.pak" type="data_package" lang="es" />
+ <output filename="app_strings_es-419.pak" type="data_package" lang="es-419" />
+ <output filename="app_strings_et.pak" type="data_package" lang="et" />
+ <output filename="app_strings_fi.pak" type="data_package" lang="fi" />
+ <output filename="app_strings_fil.pak" type="data_package" lang="fil" />
+ <output filename="app_strings_fr.pak" type="data_package" lang="fr" />
+ <output filename="app_strings_gu.pak" type="data_package" lang="gu" />
+ <output filename="app_strings_he.pak" type="data_package" lang="he" />
+ <output filename="app_strings_hi.pak" type="data_package" lang="hi" />
+ <output filename="app_strings_hr.pak" type="data_package" lang="hr" />
+ <output filename="app_strings_hu.pak" type="data_package" lang="hu" />
+ <output filename="app_strings_id.pak" type="data_package" lang="id" />
+ <output filename="app_strings_it.pak" type="data_package" lang="it" />
+ <output filename="app_strings_ja.pak" type="data_package" lang="ja" />
+ <output filename="app_strings_kn.pak" type="data_package" lang="kn" />
+ <output filename="app_strings_ko.pak" type="data_package" lang="ko" />
+ <output filename="app_strings_lt.pak" type="data_package" lang="lt" />
+ <output filename="app_strings_lv.pak" type="data_package" lang="lv" />
+ <output filename="app_strings_ml.pak" type="data_package" lang="ml" />
+ <output filename="app_strings_mr.pak" type="data_package" lang="mr" />
+ <output filename="app_strings_nl.pak" type="data_package" lang="nl" />
+ <!-- The translation console uses 'no' for Norwegian Bokmål. It should
+ be 'nb'. -->
+ <output filename="app_strings_nb.pak" type="data_package" lang="no" />
+ <output filename="app_strings_or.pak" type="data_package" lang="or" />
+ <output filename="app_strings_pl.pak" type="data_package" lang="pl" />
+ <output filename="app_strings_pt-BR.pak" type="data_package" lang="pt-BR" />
+ <output filename="app_strings_pt-PT.pak" type="data_package" lang="pt-PT" />
+ <output filename="app_strings_ro.pak" type="data_package" lang="ro" />
+ <output filename="app_strings_ru.pak" type="data_package" lang="ru" />
+ <output filename="app_strings_sk.pak" type="data_package" lang="sk" />
+ <output filename="app_strings_sl.pak" type="data_package" lang="sl" />
+ <output filename="app_strings_sr.pak" type="data_package" lang="sr" />
+ <output filename="app_strings_sv.pak" type="data_package" lang="sv" />
+ <output filename="app_strings_ta.pak" type="data_package" lang="ta" />
+ <output filename="app_strings_te.pak" type="data_package" lang="te" />
+ <output filename="app_strings_th.pak" type="data_package" lang="th" />
+ <output filename="app_strings_tr.pak" type="data_package" lang="tr" />
+ <output filename="app_strings_uk.pak" type="data_package" lang="uk" />
+ <output filename="app_strings_vi.pak" type="data_package" lang="vi" />
+ <output filename="app_strings_zh-CN.pak" type="data_package" lang="zh-CN" />
+ <output filename="app_strings_zh-TW.pak" type="data_package" lang="zh-TW" />
+ </outputs>
+ <translations>
+ <!-- TODO(beng): uncomment once we have xtbs for all of these.
+ <file path="resources/app_strings_ar.xtb" lang="ar" />
+ <file path="resources/app_strings_bg.xtb" lang="bg" />
+ <file path="resources/app_strings_bn.xtb" lang="bn" />
+ <file path="resources/app_strings_ca.xtb" lang="ca" />
+ <file path="resources/app_strings_cs.xtb" lang="cs" />
+ <file path="resources/app_strings_da.xtb" lang="da" />
+ <file path="resources/app_strings_de.xtb" lang="de" />
+ <file path="resources/app_strings_el.xtb" lang="el" />
+ <file path="resources/app_strings_en-GB.xtb" lang="en-GB" />
+ <file path="resources/app_strings_es.xtb" lang="es" />
+ <file path="resources/app_strings_es-419.xtb" lang="es-419" />
+ <file path="resources/app_strings_et.xtb" lang="et" />
+ <file path="resources/app_strings_fi.xtb" lang="fi" />
+ <file path="resources/app_strings_fil.xtb" lang="fil" />
+ <file path="resources/app_strings_fr.xtb" lang="fr" />
+ <file path="resources/app_strings_gu.xtb" lang="gu" />
+ <file path="resources/app_strings_he.xtb" lang="he" />
+ <file path="resources/app_strings_hi.xtb" lang="hi" />
+ <file path="resources/app_strings_hr.xtb" lang="hr" />
+ <file path="resources/app_strings_hu.xtb" lang="hu" />
+ <file path="resources/app_strings_id.xtb" lang="id" />
+ <file path="resources/app_strings_it.xtb" lang="it" />
+ <file path="resources/app_strings_ja.xtb" lang="ja" />
+ <file path="resources/app_strings_kn.xtb" lang="kn" />
+ <file path="resources/app_strings_ko.xtb" lang="ko" />
+ <file path="resources/app_strings_lt.xtb" lang="lt" />
+ <file path="resources/app_strings_lv.xtb" lang="lv" />
+ <file path="resources/app_strings_ml.xtb" lang="ml" />
+ <file path="resources/app_strings_mr.xtb" lang="mr" />
+ <file path="resources/app_strings_nl.xtb" lang="nl" />
+ <file path="resources/app_strings_no.xtb" lang="no" />
+ <file path="resources/app_strings_or.xtb" lang="or" />
+ <file path="resources/app_strings_pl.xtb" lang="pl" />
+ <file path="resources/app_strings_pt-BR.xtb" lang="pt-BR" />
+ <file path="resources/app_strings_pt-PT.xtb" lang="pt-PT" />
+ <file path="resources/app_strings_ro.xtb" lang="ro" />
+ <file path="resources/app_strings_ru.xtb" lang="ru" />
+ <file path="resources/app_strings_sk.xtb" lang="sk" />
+ <file path="resources/app_strings_sl.xtb" lang="sl" />
+ <file path="resources/app_strings_sr.xtb" lang="sr" />
+ <file path="resources/app_strings_sv.xtb" lang="sv" />
+ <file path="resources/app_strings_ta.xtb" lang="ta" />
+ <file path="resources/app_strings_te.xtb" lang="te" />
+ <file path="resources/app_strings_th.xtb" lang="th" />
+ <file path="resources/app_strings_tr.xtb" lang="tr" />
+ <file path="resources/app_strings_uk.xtb" lang="uk" />
+ <file path="resources/app_strings_vi.xtb" lang="vi" />
+ <file path="resources/app_strings_zh-CN.xtb" lang="zh-CN" />
+ <file path="resources/app_strings_zh-TW.xtb" lang="zh-TW" />
+ -->
+ </translations>
+ <release seq="1" allow_pseudo="false">
+ <messages fallback_to_english="true">
+
+ <!-- Menus -->
+ <message name="IDS_APP_MENU_EMPTY_SUBMENU" desc="Used when a submenu has no entries">
+ (empty)
+ </message>
+
+ <!-- General application strings -->
+ <message name="IDS_APP_UNTITLED_SHORTCUT_FILE_NAME" desc="The name of the Internet Shortcut file created for URLs dragged that have no title">
+ Untitled Web Page
+ </message>
+ <message name="IDS_APP_SAVEAS_ALL_FILES" desc="Save As dialog box default text">
+ All Files
+ </message>
+
+ </messages>
+ </release>
+</grit>
diff --git a/app/win_util.cc b/app/win_util.cc
index ace5f52..4f4f14f 100644
--- a/app/win_util.cc
+++ b/app/win_util.cc
@@ -21,7 +21,7 @@
#include "base/scoped_handle.h"
#include "base/string_util.h"
#include "base/win_util.h"
-#include "grit/generated_resources.h"
+#include "grit/app_strings.h"
#include "net/base/mime_util.h"
// Ensure that we pick up this link library.
@@ -225,7 +225,7 @@ std::wstring FormatFilterForExtensions(
const std::vector<std::wstring>& ext_desc,
bool include_all_files) {
const std::wstring all_ext = L"*.*";
- const std::wstring all_desc = l10n_util::GetString(IDS_SAVEAS_ALL_FILES);
+ const std::wstring all_desc = l10n_util::GetString(IDS_APP_SAVEAS_ALL_FILES);
DCHECK(file_ext.size()>=ext_desc.size());