Changeset 629

Show
Ignore:
Timestamp:
01/19/08 18:26:13 (11 months ago)
Author:
boo..@youngpup.net
Message:

Internationalize the new error messages in the openInEditor() code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/chrome/chromeFiles/content/browser.js

    r623 r629  
    494494      // right-click: open in editor 
    495495      openInEditor(getScriptFile(config.scripts[scriptNum]), 
    496       document.getElementById("gm-browser-bundle") 
    497               .getString("editor.prompt")); 
     496                   document.getElementById("gm-browser-bundle")); 
    498497    } 
    499498 
  • trunk/src/chrome/chromeFiles/content/manage.js

    r622 r629  
    107107function handleEditButton() { 
    108108  openInEditor(getScriptFile(selectedScript), 
    109   document.getElementById("gm-manage-bundle").getString("editor.prompt")); 
     109               document.getElementById("gm-manage-bundle")); 
    110110}; 
    111111 
  • trunk/src/chrome/chromeFiles/content/newscript.js

    r548 r629  
    5252 
    5353  // and fire up the editor! 
    54   openInEditor( 
    55     getScriptFile(script), 
    56     document.getElementById("gm-browser-bundle").getString("editor.prompt") 
    57   ); 
     54  openInEditor(getScriptFile(script), 
     55               document.getElementById("gm-browser-bundle")); 
    5856 
    5957  // persist namespace value 
  • trunk/src/chrome/chromeFiles/content/utils.js

    r627 r629  
    7373// the UI and Config rely on it. Needs rethinking. 
    7474 
    75 function openInEditor(aFile, promptTitle) { 
    76   var editor = getEditor(promptTitle); 
     75function openInEditor(aFile, stringBundle) { 
     76  var editor = getEditor(stringBundle); 
    7777  if (!editor) { 
    7878    // The user did not choose an editor. 
     
    8585    // Something may be wrong with the editor the user selected. Remove so that 
    8686    // next time they can pick a different one. 
    87     alert("Could not launch editor:\n" + e); 
     87    alert(stringBundle.getString("editor.could_not_launch") + "\n" + e); 
    8888    GM_prefRoot.remove("editor"); 
    8989    throw e; 
     
    9191} 
    9292 
    93 function getEditor(promptTitle) { 
     93function getEditor(stringBundle) { 
    9494  var editorPath = GM_prefRoot.getValue("editor"); 
    9595 
     
    120120                               .createInstance(nsIFilePicker); 
    121121 
    122     filePicker.init(window, promptTitle, nsIFilePicker.modeOpen); 
     122    filePicker.init(window, stringBundle.getString("editor.prompt"), 
     123                    nsIFilePicker.modeOpen); 
    123124    filePicker.appendFilters(nsIFilePicker.filterApplication); 
    124125    filePicker.appendFilters(nsIFilePicker.filterAll); 
     
    136137      return filePicker.file; 
    137138    } else { 
    138       // TODO: i18n 
    139       alert("Please pick an executable application to use to edit user " + 
    140             "scripts."); 
     139      alert(stringBundle.getString("editor.please_pick_executable")); 
    141140    } 
    142141  } 
  • trunk/src/chrome/chromeFiles/locale/en-US/gm-browser.properties

    r562 r629  
    2626 
    2727editor.prompt=Please choose your preferred text editor first 
     28editor.please_pick_executable=Please pick an executable application to use to edit user scripts. 
     29editor.could_not_launch=Could not launch editor. 
    2830 
    2931newscript.noname=Please provide a name for your script.