Skip to content

Commit

Permalink
#26 Notification now displays correct file separator
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyrne01 committed Oct 4, 2013
1 parent 14af13a commit 7fd2424
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 34 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Change log
## 2.0.4
- #25 Parameterized preferenceManager.load(preference)
- #26 Notification now displays correct file separator

## 2.0.3
- #21 File separator is now automatically determined

Expand Down
6 changes: 3 additions & 3 deletions lib/chromeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports.writeFile = function(saveDirectory, fileName, selectedText){
try{

file.initWithPath(saveDirectory);
file.append(fileName);
file.append(fileName);


if (file.exists() === false) {file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 420);}
Expand Down Expand Up @@ -63,11 +63,11 @@ exports.writeFile = function(saveDirectory, fileName, selectedText){

if (!components.isSuccessCode(status)) {

notificationsManager.sendMsg("saveError_id", saveDirectory, fileName);
notificationsManager.sendMsg("saveError_id", file.path);

}else{

notificationsManager.sendMsg("saveComplete_id", saveDirectory, fileName);
notificationsManager.sendMsg("saveComplete_id", file.path);
}
});
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions lib/localisationManager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var _ = require("sdk/l10n").get;

exports.loadLocalizedString = function(stringId, saveDirectory, fileName) {
exports.loadLocalizedString = function(stringId, path) {

return _(stringId, saveDirectory, fileName);
return _(stringId, path);
}
4 changes: 2 additions & 2 deletions lib/notificationsManager.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var notifications = require("sdk/notifications"),
localisationManager = require("./localisationManager");

exports.sendMsg = function(stringId, saveDirectory, fileName) {
exports.sendMsg = function(stringId, path) {

notifications.notify({
text: localisationManager.loadLocalizedString(stringId, saveDirectory, fileName),
text: localisationManager.loadLocalizedString(stringId, path),
});
}
4 changes: 2 additions & 2 deletions locale/cs-CZ.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Text uložen do "%s/%s"
saveError_id=Nelze uložit text do "%s/%s", prosím zkontrolujte, zda jste zadali platnou uložit cestu, která jste psát přístup v zvýrazněný text k souboru preference
saveComplete_id=Text uložen do "%s"
saveError_id=Nelze uložit text do "%s", prosím zkontrolujte, zda jste zadali platnou uložit cestu, která jste psát přístup v zvýrazněný text k souboru preference
saveTextToFile_id=Uložit text do souboru

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/de-DE.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Text gespeichert in "%s/%s"
saveError_id=Konnte den Text nicht in "%s/%s" speichern, bitte überprüfe das angegebene Verzeichnis in den "Save Text to File" Einstellungen und stelle sicher, dass Du dort Schreibrechte hast.
saveComplete_id=Text gespeichert in "%s"
saveError_id=Konnte den Text nicht in "%s" speichern, bitte überprüfe das angegebene Verzeichnis in den "Save Text to File" Einstellungen und stelle sicher, dass Du dort Schreibrechte hast.
saveTextToFile_id=Text speichern in Datei

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/en-GB.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Text saved to "%s/%s"
saveError_id=Could not save text to "%s/%s", Please check you have specified a valid save path which you have write access to in Save Text to File's preferences
saveComplete_id=Text saved to "%s"
saveError_id=Could not save text to "%s", Please check you have specified a valid save path which you have write access to in Save Text to File's preferences
saveTextToFile_id=Save Text to File

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/en-US.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Text saved to "%s/%s"
saveError_id=Could not save text to "%s/%s", Please check you have specified a valid save path which you have write access to in Save Text to File's preferences
saveComplete_id=Text saved to "%s"
saveError_id=Could not save text to "%s", Please check you have specified a valid save path which you have write access to in Save Text to File's preferences
saveTextToFile_id=Save Text to File

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/es-ES.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Texto guardado en "%s/%s"
saveError_id=No se pudo guardar el texto en "%s/%s". Por favor, comprueba en las preferencias de 'Guardar Texto en Archivo' que has especificado una ruta válida y que tienes permisos de escritura en esa carpeta
saveComplete_id=Texto guardado en "%s"
saveError_id=No se pudo guardar el texto en "%s". Por favor, comprueba en las preferencias de 'Guardar Texto en Archivo' que has especificado una ruta válida y que tienes permisos de escritura en esa carpeta
saveTextToFile_id=Guardar Texto en Archivo

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/fr-FR.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Texte enregistré "%s/%s"
saveError_id=Impossible d'enregistrer du texte à "%s/%s", S'il vous plaît vérifiez que vous avez spécifié un chemin d'accès valide de sauvegarde que vous avez accès en écriture au texte en surbrillance dans les préférences de fichiers de
saveComplete_id=Texte enregistré "%s"
saveError_id=Impossible d'enregistrer du texte à "%s", S'il vous plaît vérifiez que vous avez spécifié un chemin d'accès valide de sauvegarde que vous avez accès en écriture au texte en surbrillance dans les préférences de fichiers de
saveTextToFile_id=Enregistrer le texte dans un fichier

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/it-IT.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Testo salvato "%s/%s"
saveError_id=Impossibile salvare il testo in "%s/%s", Si prega di controllare di aver specificato un percorso valido di salvataggio che avete l'accesso in scrittura al testo evidenziato le preferenze file
saveComplete_id=Testo salvato "%s"
saveError_id=Impossibile salvare il testo in "%s", Si prega di controllare di aver specificato un percorso valido di salvataggio che avete l'accesso in scrittura al testo evidenziato le preferenze file
saveTextToFile_id=Salva il testo in un file

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/ja-JP.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=テキストはに保存 "%s/%s"
saveError_id=にテキストを保存できませんでした "%s/%s", あなたはファイルの好みにテキストを保存するにはへの書き込みアクセスをしている有効な保存パスを指定して確認してください
saveComplete_id=テキストはに保存 "%s"
saveError_id=にテキストを保存できませんでした "%s", あなたはファイルの好みにテキストを保存するにはへの書き込みアクセスをしている有効な保存パスを指定して確認してください
saveTextToFile_id=選択テキストをファイルに保存

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/ko-KR.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=텍스트에 저장"%s/%s"
saveError_id=텍스트를 저장할 수 없습니다 "%s/%s", 당신이 파일의 환경 설정에 텍스트를 저장에 대한 쓰기 액세스 권한이 유효한 저장 경로를 지정하시기 바랍니다
saveComplete_id=텍스트에 저장"%s"
saveError_id=텍스트를 저장할 수 없습니다 "%s", 당신이 파일의 환경 설정에 텍스트를 저장에 대한 쓰기 액세스 권한이 유효한 저장 경로를 지정하시기 바랍니다
saveTextToFile_id=파일에 텍스트를 저장

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/pl-PL.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Tekst zapisany "%s/%s"
saveError_id=Nie można zapisać tekst do "%s/%s", Proszę sprawdzić podałeś prawidłową ścieżkę zapisu których masz dostęp w Zapisz tekst do pliku preferencji
saveComplete_id=Tekst zapisany "%s"
saveError_id=Nie można zapisać tekst do "%s", Proszę sprawdzić podałeś prawidłową ścieżkę zapisu których masz dostęp w Zapisz tekst do pliku preferencji
saveTextToFile_id=Zapisz tekst do pliku

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/ru-RU.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Текст сохранен в "%s/%s"
saveError_id=Не может сохранить текст "%s/%s", Пожалуйста, проверьте вы указали правильный путь сохранения которой у вас есть доступ в Сохранить текст в файл настроек по
saveComplete_id=Текст сохранен в "%s"
saveError_id=Не может сохранить текст "%s", Пожалуйста, проверьте вы указали правильный путь сохранения которой у вас есть доступ в Сохранить текст в файл настроек по
saveTextToFile_id=Сохранить текст в файл

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/uk-UA.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=Текст збережений в "%s/%s"
saveError_id=Не може зберегти текст "%s/%s", Будь ласка, перевірте ви вказали правильний шлях збереження якої у вас є доступ в Зберегти текст у файл настройок по
saveComplete_id=Текст збережений в "%s"
saveError_id=Не може зберегти текст "%s", Будь ласка, перевірте ви вказали правильний шлях збереження якої у вас є доступ в Зберегти текст у файл настройок по
saveTextToFile_id=Зберегти текст у файл

# Preference localization
Expand Down
4 changes: 2 additions & 2 deletions locale/zh-CH.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveComplete_id=保存到文本 "%s/%s"
saveError_id=無法保存文本 "%s/%s", 請檢查你已經指定了一個有效的保存路徑,你已經寫訪問保存文本文件的喜好
saveComplete_id=保存到文本 "%s"
saveError_id=無法保存文本 "%s", 請檢查你已經指定了一個有效的保存路徑,你已經寫訪問保存文本文件的喜好
saveTextToFile_id=保存文本文件

# Preference localization
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Saves highlighted text to a file in a specified directory",
"author": "Robert Byrne",
"license": "GNU GPL v3",
"version": "2.0.3",
"version": "2.0.4",
"preferences": [{
"name": "fileName",
"title": "File name?",
Expand Down

0 comments on commit 7fd2424

Please sign in to comment.