bug 600214 - Use string resources for android java files r=mwu a=blocking-fennec

This commit is contained in:
Brad Lassey 2010-09-28 14:59:22 -04:00
Родитель 9eb7468940
Коммит 8b50ba131e
4 изменённых файлов: 32 добавлений и 8 удалений

Просмотреть файл

@ -138,9 +138,8 @@ abstract public class GeckoApp
int version = Integer.parseInt(versionStr);
if (version < getMinCPUVersion()) {
showErrorDialog("This device does not meet the " +
"minimum system requirements for " +
getAppName() + ".");
showErrorDialog(
getString(R.string.incompatable_cpu_error));
return;
}
else {
@ -155,8 +154,9 @@ abstract public class GeckoApp
if (!useLaunchButton)
mProgressDialog =
ProgressDialog.show(GeckoApp.this, "", getAppName() +
" is loading", true);
ProgressDialog.show(GeckoApp.this, "",
getString(R.string.splash_screen_label),
true);
// Load our JNI libs; we need to do this before launch() because
// setInitialSize will be called even before Gecko is actually up
// and running.
@ -164,7 +164,7 @@ abstract public class GeckoApp
if (useLaunchButton) {
final Button b = new Button(this);
b.setText("Launch");
b.setText("Launch"); // don't need to localize
b.setOnClickListener(new Button.OnClickListener() {
public void onClick (View v) {
// hide the button so we can't be launched again

Просмотреть файл

@ -80,6 +80,8 @@ GARBAGE += \
gecko.ap_ \
gecko-unaligned.apk \
gecko-unsigned-unaligned.apk \
res/values/strings.xml \
R.java \
$(NULL)
GARBAGE_DIRS += res libs dist classes
@ -136,6 +138,9 @@ endif
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
DEFAULT_BRANDPATH = $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/en-US/brand.dtd
DEFAULT_STRINGSPATH = android_strings.dtd
include $(topsrcdir)/config/rules.mk
# Override the Java settings with some specific android settings
@ -170,10 +175,10 @@ $(RES_DRAWABLE_HDPI):
$(NSINSTALL) -D res/drawable-hdpi
cp $(topsrcdir)/mobile/app/android/drawable-hdpi/* res/drawable-hdpi/
R.java: $(MOZ_APP_ICON) $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI)
R.java: $(MOZ_APP_ICON) $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI) res/values/strings.xml $(LOCALIZED_STRINGS_XML) AndroidManifest.xml
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko
gecko.ap_: AndroidManifest.xml res/drawable/icon.png res/drawable-hdpi/icon.png $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI)
gecko.ap_: AndroidManifest.xml res/drawable/icon.png res/drawable-hdpi/icon.png $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI) res/values/strings.xml $(LOCALIZED_STRINGS_XML)
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
libs/armeabi/%: $(DIST)/lib/%
@ -209,3 +214,10 @@ endif
$(MOZ_APP_NAME).apk: gecko-unaligned.apk
$(ZIPALIGN) -f -v 4 gecko-unaligned.apk $@
res/values/strings.xml: FORCE
mkdir -p res/values
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
-DBRANDPATH="$(DEFAULT_BRANDPATH)" \
-DSTRINGSPATH="$(DEFAULT_STRINGSPATH)" \
$(srcdir)/strings.xml.in \
> $@

Просмотреть файл

@ -0,0 +1,2 @@
<!ENTITY splash_screen_label "&brandShortName; is loading">
<!ENTITY incompatable_cpu_error "This device does not meet the minimum system requirements for &brandShortName;.">

Просмотреть файл

@ -0,0 +1,10 @@
#filter substitution
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE resources [
#includesubst @BRANDPATH@
#includesubst @STRINGSPATH@
]>
<resources>
<string name="splash_screen_label">&splash_screen_label;</string>
<string name="incompatable_cpu_error">&incompatable_cpu_error;</string>
</resources>