Converted interface strings into localized entities/properties.

Fixed: New Item shows the metadata pane if it is not already shown.
This commit is contained in:
David Norton 2006-06-05 17:47:36 +00:00
parent 0a234c9f70
commit 560864ad6b
9 changed files with 56 additions and 37 deletions

View file

@ -279,7 +279,7 @@ Scholar.ItemGroup.prototype.getName = function()
if(this.isCollection()) if(this.isCollection())
return this.ref.getName(); return this.ref.getName();
else if(this.isLibrary()) else if(this.isLibrary())
return "Library"; return Scholar.getString('pane.collections.library');
else else
return ""; return "";
} }

View file

@ -36,7 +36,7 @@ MetadataPane = new function()
function viewItem(thisItem) function viewItem(thisItem)
{ {
if(_editButton.hidden) if(_editButton.hidden)
toggleEdit(confirm("Save changes to '"+_itemBeingEdited.getField('title')+"'?")); toggleEdit(confirm(Scholar.getString('metadata.savechanges').replace('%1',_itemBeingEdited.getField('title'))));
_itemBeingEdited = thisItem; _itemBeingEdited = thisItem;

View file

@ -1,4 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE window SYSTEM "chrome://scholar/locale/scholar.dtd">
<overlay <overlay
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@ -16,7 +17,7 @@
</rows> </rows>
</grid> </grid>
<toolbar id="metadata-creators-toolbar" hidden="true"> <toolbar id="metadata-creators-toolbar" hidden="true">
<label value="Creators"/> <label value="&metadata.creators.label;"/>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton label="+" oncommand="MetadataPane.addCreator()" class="addremove"/> <toolbarbutton label="+" oncommand="MetadataPane.addCreator()" class="addremove"/>
</toolbar> </toolbar>
@ -34,9 +35,9 @@
</grid> </grid>
<spacer flex="1"/> <spacer flex="1"/>
<toolbar id="metadata-toolbar"> <toolbar id="metadata-toolbar">
<toolbarbutton id="metadata-pane-edit-button" label="Edit" oncommand="MetadataPane.toggleEdit()"/> <toolbarbutton id="metadata-pane-edit-button" label="&metadata.edit.label;" oncommand="MetadataPane.toggleEdit()"/>
<toolbarbutton id="metadata-pane-cancel-button" label="Cancel" oncommand="MetadataPane.toggleEdit()" hidden="true"/> <toolbarbutton id="metadata-pane-cancel-button" label="&metadata.cancel.label;" oncommand="MetadataPane.toggleEdit()" hidden="true"/>
<toolbarbutton id="metadata-pane-save-button" label="Save" oncommand="MetadataPane.toggleEdit(true)" hidden="true"/> <toolbarbutton id="metadata-pane-save-button" label="&metadata.save.label;" oncommand="MetadataPane.toggleEdit(true)" hidden="true"/>
<spacer flex="1" /> <spacer flex="1" />
</toolbar> </toolbar>
</vbox> </vbox>

View file

@ -74,13 +74,14 @@ var ScholarPane = new function()
*/ */
function newItem(typeID) function newItem(typeID)
{ {
document.getElementById('scholar-floater').hidden=false;
MetadataPane.viewItem(new Scholar.Item(typeID)); MetadataPane.viewItem(new Scholar.Item(typeID));
MetadataPane.toggleEdit(); MetadataPane.toggleEdit();
} }
function newCollection() function newCollection()
{ {
Scholar.Collections.add('Untitled Collection'); Scholar.Collections.add(Scholar.getString('pane.collections.untitled'));
} }
function folderSelected() function folderSelected()
@ -130,13 +131,13 @@ var ScholarPane = new function()
function deleteItemSelection() function deleteItemSelection()
{ {
if(itemsView && itemsView.selection.count > 0 && confirm("Are you sure you want to delete the selected items?")) if(itemsView && itemsView.selection.count > 0 && confirm(Scholar.getString('pane.items.delete')))
itemsView.deleteSelection(); itemsView.deleteSelection();
} }
function deleteCollectionSelection() function deleteCollectionSelection()
{ {
if(foldersView.selection.count > 0 && confirm("Are you sure you want to delete the selected collections?")) if(foldersView.selection.count > 0 && confirm(Scholar.getString('pane.collections.delete')))
foldersView.deleteSelection(); foldersView.deleteSelection();
} }
@ -146,7 +147,7 @@ var ScholarPane = new function()
{ {
collection = foldersView._getItemAtRow(foldersView.selection.currentIndex); collection = foldersView._getItemAtRow(foldersView.selection.currentIndex);
var newName = prompt('Rename collection:',collection.getName()); var newName = prompt(Scholar.getString('pane.collections.rename'),collection.getName());
if(newName) if(newName)
collection.ref.rename(newName); collection.ref.rename(newName);
} }
@ -180,7 +181,7 @@ var ScholarItemsDragObserver =
onDragStart: function (evt,transferData,action) onDragStart: function (evt,transferData,action)
{ {
transferData.data=new TransferData(); transferData.data=new TransferData();
transferData.data.addDataForFlavour("text/unicode","finally"); transferData.data.addDataForFlavour("text/unicode","random data");
} }
}; };

View file

@ -23,14 +23,14 @@
<vbox id="scholar-floater" hidden="true"> <vbox id="scholar-floater" hidden="true">
<vbox id="scholar-metadata"> <vbox id="scholar-metadata">
<toolbar> <toolbar>
<label value="Metadata"/> <label value="&metadata.label;"/>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleView('metadata')"/> <toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleView('metadata')"/>
</toolbar> </toolbar>
</vbox> </vbox>
<vbox id="scholar-notes"> <vbox id="scholar-notes">
<toolbar> <toolbar>
<label value="Notes"/> <label value="&notes.label;"/>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleView('notes')"/> <toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleView('notes')"/>
</toolbar> </toolbar>
@ -43,8 +43,8 @@
<hbox id="scholar-pane" position="1" persist="height collapsed"> <hbox id="scholar-pane" position="1" persist="height collapsed">
<vbox persist="width" flex="1"> <vbox persist="width" flex="1">
<toolbar> <toolbar>
<toolbarbutton label="&menuitem.newCollection.label;" command="cmd_scholar_newCollection"/> <toolbarbutton label="&toolbar.newCollection.label;" command="cmd_scholar_newCollection"/>
<toolbarbutton id="tb-rename" label="Rename Collection" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/> <toolbarbutton id="tb-rename" label="&toolbar.renameCollection.label;" oncommand="ScholarPane.renameSelectedCollection();" disabled="true"/>
</toolbar> </toolbar>
<tree id="folders-tree" hidecolumnpicker="true" <tree id="folders-tree" hidecolumnpicker="true"
onselect="ScholarPane.folderSelected();" seltype="single" onselect="ScholarPane.folderSelected();" seltype="single"
@ -64,15 +64,15 @@
<splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/> <splitter id="scholar-tree-splitter" resizebefore="closest" resizeafter="closest"/>
<vbox persist="width" flex="5"> <vbox persist="width" flex="5">
<toolbar align="center"> <toolbar align="center">
<toolbarbutton id="tb-add" label="&menuitem.newItem.label;" type="menu"> <toolbarbutton id="tb-add" label="&toolbar.newItem.label;" type="menu">
<menupopup> <menupopup>
</menupopup> </menupopup>
</toolbarbutton> </toolbarbutton>
<spacer flex="1"/> <spacer flex="1"/>
<toolbarbutton class="scholar-toggler" id="tb-metadata" label="Metadata" checked="true" oncommand="ScholarPane.toggleView('metadata')"/> <toolbarbutton class="scholar-toggler" id="tb-metadata" label="&toolbar.metadata.label;" checked="true" oncommand="ScholarPane.toggleView('metadata')"/>
<toolbarbutton class="scholar-toggler" id="tb-notes" label="Notes" checked="true" oncommand="ScholarPane.toggleView('notes')"/> <toolbarbutton class="scholar-toggler" id="tb-notes" label="&toolbar.notes.label;" checked="true" oncommand="ScholarPane.toggleView('notes')"/>
<spacer flex="1"/> <spacer flex="1"/>
<label value="Search:" control="tb-search"/> <label value="&toolbar.search.label;" control="tb-search"/>
<textbox id="tb-search" type="timed" timeout="500" command="cmd_scholar_search"/> <textbox id="tb-search" type="timed" timeout="500" command="cmd_scholar_search"/>
<toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/> <toolbarbutton class="tabs-closebutton" oncommand="ScholarPane.toggleDisplay()"/>
</toolbar> </toolbar>
@ -137,7 +137,7 @@
<menupopup id="menu_ToolsPopup"> <menupopup id="menu_ToolsPopup">
<menuseparator id="scholarSeparator" insertbefore="devToolsSeparator"/> <menuseparator id="scholarSeparator" insertbefore="devToolsSeparator"/>
<menuitem id="tools-scholar" insertbefore="devToolsSeparator" <menuitem id="tools-scholar" insertbefore="devToolsSeparator"
oncommand="ScholarPane.toggleDisplay();" label="Scholar" oncommand="ScholarPane.toggleDisplay();" label="&scholar.name;"
key="key_openScholar"/> key="key_openScholar"/>
</menupopup> </menupopup>

View file

@ -1,14 +1,16 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE window SYSTEM "chrome://scholar/locale/preferences.dtd">
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<dialog id="winMain" title="Scholar Preferences" style="min-width:400px;" <dialog id="winMain" title="&scholar.preferences.title;" style="min-width:400px;"
onload="init();" ondialogaccept="accept()" onload="init();" ondialogaccept="accept()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="preferences.js"/> <script src="preferences.js"/>
<script src="include.js"/> <script src="include.js"/>
<dialogheader id="header" title="Scholar" description="Scholar Preferences"/> <dialogheader id="header" title="&scholar.name;" description="&scholar.preferences.title;"/>
<checkbox id="whateverBox" label="Whatever!"/> <checkbox id="whateverBox" label="Whatever!"/>

View file

@ -0,0 +1,2 @@
<!ENTITY scholar.name "Scholar">
<!ENTITY scholar.preferences.title "Scholar Preferences">

View file

@ -1,3 +1,13 @@
<!ENTITY scholar.name "Scholar">
<!ENTITY metadata.label "Metadata">
<!ENTITY notes.label "Notes">
<!ENTITY metadata.creators.label "Creators">
<!ENTITY metadata.edit.label "Edit">
<!ENTITY metadata.cancel.label "Cancel">
<!ENTITY metadata.save.label "Save">
<!ENTITY items.title_column "Title"> <!ENTITY items.title_column "Title">
<!ENTITY items.creator_column "Creator"> <!ENTITY items.creator_column "Creator">
<!ENTITY items.source_column "Source"> <!ENTITY items.source_column "Source">
@ -7,20 +17,12 @@
<!ENTITY collections.name_column "Name"> <!ENTITY collections.name_column "Name">
<!ENTITY creators.firstname "First name"> <!ENTITY toolbar.newItem.label "New Item">
<!ENTITY creators.lastname "Last name"> <!ENTITY toolbar.newCollection.label "New Project">
<!ENTITY creators.type "Type"> <!ENTITY toolbar.renameCollection.label "Rename Project...">
<!ENTITY toolbar.search.label "Search:">
<!ENTITY fileMenu.label "File"> <!ENTITY toolbar.metadata.label "Metadata">
<!ENTITY fileMenu.accesskey "F"> <!ENTITY toolbar.notes.label "Notes">
<!ENTITY viewMenu.label "View">
<!ENTITY viewMenu.accesskey "V">
<!ENTITY menuitem.newItem.label "New Item...">
<!ENTITY menuitem.newItem.accesskey "n">
<!ENTITY menuitem.newCollection.label "New Collection...">
<!ENTITY menuitem.newFolder.accesskey "o">
<!ENTITY closeCmd.label "Close"> <!ENTITY closeCmd.label "Close">
<!ENTITY closeCmd.accesskey "C"> <!ENTITY closeCmd.accesskey "C">

View file

@ -1,3 +1,14 @@
pane.items.delete = Are you sure you want to delete the selected item?
pane.items.delete.multiple = Are you sure you want to delete the selected items?
pane.collections.delete = Are you sure you want to delete the selected collection?
pane.collections.delete.multiple = Are you sure you want to delete the selected collections?
pane.collections.rename = Rename collection:
pane.collections.library = Library
pane.collections.untitled = Untitled Collection
metadata.savechanges = Do you want to save changes to '%1'?
itemFields.title = Title itemFields.title = Title
itemFields.dateAdded = Date Added itemFields.dateAdded = Date Added
itemFields.dateModified = Modified itemFields.dateModified = Modified