зеркало из https://github.com/mozilla/pjs.git
Localize the alert message for missing MathML fonts, b=128139, r=Roland.Mainz@informatik.med.uni-giessen.de, sr=attinasi, a=asa
This commit is contained in:
Родитель
b8da58166d
Коммит
8497062035
|
@ -37,6 +37,7 @@ REQUIRES = xpcom \
|
|||
widget \
|
||||
webshell \
|
||||
locale \
|
||||
intl \
|
||||
unicharutil \
|
||||
view \
|
||||
necko \
|
||||
|
|
|
@ -1,116 +0,0 @@
|
|||
#!nmake
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla MathML Project.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Heriot-Watt
|
||||
# University, Edinburgh. Portions created by Heriot-Watt University
|
||||
# are Copyright (C) 1999 Heriot-Watt University. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# David J. Fiddes <D.J.Fiddes@hw.ac.uk>
|
||||
#
|
||||
|
||||
DEPTH=..\..\..\..
|
||||
|
||||
LIBRARY_NAME=layoutmathmlbase_s
|
||||
MODULE=layout
|
||||
REQUIRES = xpcom \
|
||||
content \
|
||||
widget \
|
||||
string \
|
||||
gfx \
|
||||
locale \
|
||||
unicharutil \
|
||||
webshell \
|
||||
necko \
|
||||
dom \
|
||||
view \
|
||||
docshell \
|
||||
webbrowser_core \
|
||||
windowwatcher \
|
||||
pref \
|
||||
$(NULL)
|
||||
|
||||
DEFINES= -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
CPP_OBJS= .\$(OBJDIR)\nsMathMLChar.obj \
|
||||
.\$(OBJDIR)\nsMathMLFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLContainerFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLForeignFrameWrapper.obj \
|
||||
.\$(OBJDIR)\nsMathMLmrowFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmphantomFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmfencedFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmfracFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmsubFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmiFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmtextFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmsubsupFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmmultiscriptsFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmsupFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmtableFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmoFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmunderFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmoverFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmunderoverFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmpaddedFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmspaceFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmsFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmstyleFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmsqrtFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmrootFrame.obj \
|
||||
.\$(OBJDIR)\nsMathMLmactionFrame.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
$(NULL)
|
||||
|
||||
LINCS= \
|
||||
-I..\..\..\html\style\src \
|
||||
-I..\..\..\html\base\src \
|
||||
-I..\..\..\base\src \
|
||||
-I..\..\..\html\table\src \
|
||||
-I..\..\content\src \
|
||||
$(NULL)
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
$(DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
libs::
|
||||
$(MAKE_INSTALL) mathfont.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontPUA.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontCMSY10.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontCMEX10.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontMTExtra.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontMath1.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontMath2.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontMath4.properties $(DIST)\bin\res\fonts
|
||||
$(MAKE_INSTALL) mathfontSymbol.properties $(DIST)\bin\res\fonts
|
||||
|
||||
clobber::
|
||||
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
|
||||
rm -f $(DIST)\bin\res\fonts\mathfont.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontPUA.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontCMSY10.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontCMEX10.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontMTExtra.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontMath1.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontMath2.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontMath4.properties
|
||||
rm -f $(DIST)\bin\res\fonts\mathfontSymbol.properties
|
|
@ -19,8 +19,15 @@
|
|||
## Roger B. Sidje <rbs@maths.uq.edu.au>
|
||||
##
|
||||
|
||||
# LOCALIZATION NOTE: FILE
|
||||
# Do not translate anything in this file
|
||||
##LOCALIZATION NOTE:
|
||||
# These are used to display an alert box to warn users when MathML fonts
|
||||
# are not installed on their system. The list of missing fonts will be
|
||||
# substituted in argument %1$S (see a screenshot in bug 128139).
|
||||
mathfont_missing_dialog_title = Missing MathML Fonts
|
||||
mathfont_missing_dialog_message = To properly display the MathML on this page you need to install the following fonts:\n%1$S.\n\n\n For further information see:\nhttp://www.mozilla.org/projects/mathml/fonts
|
||||
|
||||
##LOCALIZATION NOTE:
|
||||
# Do not translate anything else in this file
|
||||
|
||||
# Ordered list of fonts with which to attempt to stretch MathML characters.
|
||||
# See the documentation at the end of this file for details on the setup of
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDialogParamBlock.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
||||
#include "nsMathMLOperators.h"
|
||||
#include "nsMathMLChar.h"
|
||||
|
@ -138,10 +139,28 @@ CheckFontExistence(nsIPresContext* aPresContext, const nsString& aFontName)
|
|||
static void
|
||||
AlertMissingFonts(nsString& aMissingFonts)
|
||||
{
|
||||
nsCOMPtr<nsIStringBundleService> sbs(do_GetService(NS_STRINGBUNDLE_CONTRACTID));
|
||||
if (!sbs)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIStringBundle> sb;
|
||||
sbs->CreateBundle("resource:/res/fonts/mathfont.properties", getter_AddRefs(sb));
|
||||
if (!sb)
|
||||
return;
|
||||
|
||||
nsXPIDLString title, message;
|
||||
const PRUnichar* strings[] = { aMissingFonts.get() };
|
||||
sb->GetStringFromName(NS_LITERAL_STRING("mathfont_missing_dialog_title").get(), getter_Copies(title));
|
||||
sb->FormatStringFromName(NS_LITERAL_STRING("mathfont_missing_dialog_message").get(),
|
||||
strings, 1, getter_Copies(message));
|
||||
|
||||
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
|
||||
if (wwatch) {
|
||||
if (!wwatch)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> paramBlock(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
if (!paramBlock) return;
|
||||
if (!paramBlock)
|
||||
return;
|
||||
|
||||
// copied from nsICommonDialogs.idl which curiously isn't part of the build
|
||||
// (mozilla/xpfe/appshell/public/nsICommonDialogs.idl)
|
||||
|
@ -151,21 +170,10 @@ AlertMissingFonts(nsString& aMissingFonts)
|
|||
enum {eButtonPressed=0, eCheckboxState=1, eNumberButtons=2, eNumberEditfields=3,
|
||||
eEditField1Password=4};
|
||||
|
||||
nsAutoString icon;
|
||||
icon.Assign(NS_LITERAL_STRING("alert-icon"));
|
||||
|
||||
nsAutoString title;
|
||||
title.Assign(NS_LITERAL_STRING("Missing MathML Fonts"));
|
||||
|
||||
nsAutoString message;
|
||||
message.Assign(NS_LITERAL_STRING("To properly display the MathML on this page you need to install the following fonts:\n"));
|
||||
message.Append(aMissingFonts);
|
||||
message.Append(NS_LITERAL_STRING(".\n\n\n For further information see:\n http://www.mozilla.org/projects/mathml/fonts"));
|
||||
|
||||
paramBlock->SetInt(eNumberButtons, 1);
|
||||
paramBlock->SetString(eIconClass, NS_LITERAL_STRING("alert-icon").get());
|
||||
paramBlock->SetString(eDialogTitle, title.get());
|
||||
paramBlock->SetString(eMsg, message.get());
|
||||
paramBlock->SetString(eIconClass, icon.get());
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> parent;
|
||||
wwatch->GetActiveWindow(getter_AddRefs(parent));
|
||||
|
@ -174,7 +182,6 @@ AlertMissingFonts(nsString& aMissingFonts)
|
|||
wwatch->OpenWindow(parent, "chrome://global/content/commonDialog.xul", "_blank",
|
||||
"dependent,centerscreen,chrome,titlebar", paramBlock,
|
||||
getter_AddRefs(dialog));
|
||||
}
|
||||
}
|
||||
|
||||
// helper to trim off comments from data in a MathFont Property File
|
||||
|
|
Загрузка…
Ссылка в новой задаче