proof of concept l10n for ui menus

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@922 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-07-26 07:09:53 +00:00
parent fdc357ba2b
commit 5458081c09
9 changed files with 2733 additions and 1323 deletions

View File

@ -33,6 +33,11 @@ for fil in config/libtool.m4 ; do
done
echo "done."
# Generate the ext_l10n.h
echo -n "Generate the ext_l10n file..."
grep -i -E "submenu|item|optitem" < lib/ui/default.ui | cut -d '"' -f 2 | awk '{printf "_(\"%s\");\n", $0}' > src/ext_l10n.h
echo "done."
# Generate the Makefiles and configure files
if ( aclocal --version ) </dev/null > /dev/null 2>&1; then
echo -n "Building macros... "
@ -97,7 +102,7 @@ cat <<EOF > tmppot
EOF
grep -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
grep -l -E "_\(\".*\"\)" `find src -name \*.[hHC]` | \
awk 'BEGIN {FS= ":"} {print $1}' | sort -f -d | uniq >> tmppot
mv tmppot po/POTFILES.in
echo "done"

View File

@ -101,7 +101,7 @@ Menuset
Separator
Item "View LaTeX log file|w" "latex-view-log"
Separator
SubMenu "Paste primary selection" "edit_paste"
Submenu "Paste primary selection" "edit_paste"
End
Menu "edit_floats"

View File

@ -22,6 +22,7 @@ src/combox.C
src/credits.C
src/credits_form.C
src/CutAndPaste.C
src/ext_l10n.h
src/filedlg.C
src/FontLoader.C
src/form1.C

3852
po/no.po

File diff suppressed because it is too large Load Diff

View File

@ -117,6 +117,7 @@ lyx_SOURCES = \
debug.h \
encoding.C \
encoding.h \
ext_l10n.h \
figure.h \
filedlg.C \
filedlg.h \

View File

@ -19,6 +19,7 @@
#include "lyxlex.h"
#include "LyXAction.h"
#include "debug.h"
#include "gettext.h"
extern LyXAction lyxaction;
@ -99,7 +100,7 @@ void Menu::read(LyXLex & lex)
// fallback to md_item
case md_item: {
lex.next();
string name = lex.GetString();
string name = _(lex.GetString().c_str());
lex.next();
string command = lex.GetString();
add(MenuItem(MenuItem::Command, name,
@ -118,7 +119,7 @@ void Menu::read(LyXLex & lex)
break;
case md_submenu: {
lex.next();
string mlabel = lex.GetString();
string mlabel = _(lex.GetString().c_str());
lex.next();
string mname = lex.GetString();
add(MenuItem(MenuItem::Submenu, mlabel, mname));
@ -203,10 +204,10 @@ void MenuBackend::defaults()
Menu file("file");
file
.add(MenuItem(MenuItem::Command, "New...|N", "buffer-new"))
.add(MenuItem(MenuItem::Command, "Open...|O", "buffer-open"))
.add(MenuItem(MenuItem::Submenu, "Import|I", "import"))
.add(MenuItem(MenuItem::Command, "Quit|Q", "lyx-quit"))
.add(MenuItem(MenuItem::Command, N_("New...|N"), "buffer-new"))
.add(MenuItem(MenuItem::Command, N_("Open...|O"), "buffer-open"))
.add(MenuItem(MenuItem::Submenu, N_("Import|I"), "import"))
.add(MenuItem(MenuItem::Command, N_("Quit|Q"), "lyx-quit"))
.add(MenuItem(MenuItem::Separator))
.add(MenuItem(MenuItem::Lastfiles));
add(file);
@ -214,17 +215,17 @@ void MenuBackend::defaults()
Menu import("import");
import
.add(MenuItem(MenuItem::Command,
"LaTeX...|L", "buffer-import latex"))
N_("LaTeX...|L"), "buffer-import latex"))
.add(MenuItem(MenuItem::Command,
"LinuxDoc...|L", "buffer-import linuxdoc"));
N_("LinuxDoc...|L"), "buffer-import linuxdoc"));
add(import);
Menu edit("edit");
edit
.add(MenuItem(MenuItem::Command, "Cut", "cut"))
.add(MenuItem(MenuItem::Command, "Copy", "copy"))
.add(MenuItem(MenuItem::Command, "Paste", "paste"))
.add(MenuItem(MenuItem::Command, "Emphasize", "font-emph"));
.add(MenuItem(MenuItem::Command, N_("Cut"), "cut"))
.add(MenuItem(MenuItem::Command, N_("Copy"), "copy"))
.add(MenuItem(MenuItem::Command, N_("Paste"), "paste"))
.add(MenuItem(MenuItem::Command, N_("Emphasize"), "font-emph"));
add(edit);
Menu documents("documents");
@ -233,14 +234,14 @@ void MenuBackend::defaults()
Menu main("main", true);
main
.add(MenuItem(MenuItem::Submenu, "File|F", "file"))
.add(MenuItem(MenuItem::Submenu, "Edit|E", "edit"))
.add(MenuItem(MenuItem::Submenu,
"Documents|D", "documents"));
.add(MenuItem(MenuItem::Submenu, N_("File|F"), "file"))
.add(MenuItem(MenuItem::Submenu, N_("Edit|E"), "edit"))
.add(MenuItem(MenuItem::Submenu,
N_("Documents|D"), "documents"));
add(main);
Menu main_nobuffer("main_nobuffer", true);
main_nobuffer.add(MenuItem(MenuItem::Submenu, "File|F", "file"));
main_nobuffer.add(MenuItem(MenuItem::Submenu, N_("File|F"), "file"));
add(main_nobuffer);
if (lyxerr.debugging(Debug::GUI)) {

151
src/ext_l10n.h Normal file
View File

@ -0,0 +1,151 @@
_("File|F");
_("Edit|E");
_("Layout|L");
_("Insert|I");
_("Math|M");
_("Options|O");
_("Documents|D");
_("Help|H");
_("File|F");
_("Options|O");
_("Help|H");
_("New...|N");
_("New from template|t");
_("Open...|O");
_("Close|C");
_("Save|S");
_("Save As|A");
_("Revert to saved|R");
_("View dvi|d");
_("View Postscript|w");
_("Update dvi|v");
_("Update Postscript|u");
_("Build program|B");
_("Print...|P");
_("Fax...|F");
_("Import|I");
_("Export|E");
_("Exit|x");
_("New...|N");
_("New from template|t");
_("Open...|O");
_("Import|I");
_("Exit|x");
_("LaTeX|L");
_("Ascii text as lines|A");
_("Ascii text as paragraphs|p");
_("Noweb|N");
_("as LaTeX|L");
_("as LinuxDoc|L");
_("as DocBook|B");
_("as DVI|D");
_("as Postscript|P");
_("as Ascii|A");
_("as HTML|H");
_("as HTML|H");
_("as HTML|H");
_("Custom...|C");
_("Undo|U");
_("Redo|R");
_("Cut|C");
_("Copy|o");
_("Paste|P");
_("Find & Replace...|F");
_("Go to Error|E");
_("Go to Note|N");
_("Floats & Insets|I");
_("Table");
_("Spellchecker...|S");
_("Check TeX|h");
_("Table of Contents|b");
_("Version control");
_("View LaTeX log file|w");
_("Paste primary selection");
_("as Lines|L");
_("as Paragraphs|g");
_("Register|R");
_("Check In Changes|I");
_("Check Out for Edit|O");
_("Revert to last version|l");
_("Undo last check in|U");
_("Show History|H");
_("Character...|C");
_("Paragraph...|P");
_("Paper...|a");
_("Document...|D");
_("Table...|T");
_("Quotes...|Q");
_("Emphasize Style|E");
_("Noun Style|N");
_("Bold Style|B");
_("TeX Style|x");
_("Change environment depth|v");
_("LaTeX preamble|a");
_("Start of Appendix|x");
_("Save layout as default|S");
_("Figure...|F");
_("Table...|T");
_("Include File...|I");
_("Import ascii file|a");
_("Insert LyX file|X");
_("Insert external material...|e");
_("Footnote|F");
_("Marginnote|M");
_("Floats|a");
_("Lists & TOC|T");
_("Special character|S");
_("Note...|N");
_("Label...|L");
_("Cross reference...|r");
_("Citation reference...|i");
_("Index entry...|d");
_("Index entry of last word|w");
_("URL...|U");
_("As lines|l");
_("As paragraphs|p");
_("Figure float|F");
_("Table float|T");
_("Wide figure float|W");
_("Wide table float|d");
_("Algorithm float|A");
_("Table of Contents|C");
_("List of Figures|F");
_("List of Tables|T");
_("List of Algorithms|A");
_("Index List|I");
_("BibTeX reference|B");
_("HFill|H");
_("Hyphenation point|p");
_("Protected blank|b");
_("Linebreak|L");
_("Ellipsis|i");
_("End of sentence|E");
_("Ordinary Quote|Q");
_("Menu Separator|M");
_("Fraction|F");
_("Square root|S");
_("Exponent|E");
_("Index|x");
_("Sum|u");
_("Integral|I");
_("Math mode|M");
_("Display|D");
_("Math Panel...|P");
_("Screen Fonts...|F");
_("Spellchecker Options...|S");
_("Keyboard...|K");
_("Reconfigure|R");
_("Preferences|P");
_("Introduction|I");
_("Tutorial|T");
_("User's Guide|U");
_("Extended Features|x");
_("Customization|C");
_("Reference Manual|R");
_("FAQ|F");
_("Table of contents|a");
_("Known Bugs|K");
_("LaTeX Configuration|L");
_("Copyright and Warranty...|o");
_("Credits...|e");
_("Version...|V");

View File

@ -39,8 +39,9 @@ public:
//I disable this temporarily until I find a nice way to make it work
//with compaq cxx.
//private:
//with compaq cxx. (Jean-Marc)
// Is this a new comment? (Lgb)
private:
struct Pimpl;
friend struct Pimpl;
Pimpl * pimpl_;

View File

@ -405,7 +405,7 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
disable = (! buf->isDocBook()
|| lyxrc.docbook_to_html_command == "none");
else if (argument == "custom")
disable == ! buf->isLatex();
disable = ! buf->isLatex();
break;
case LFUN_UNDO:
disable = buf->undostack.empty();