Merge pull request #26 from ecraven/no-fuzzy-option

Add -e for exact searches (no fuzzy matches).
This commit is contained in:
Evgeniy Dushistov
2017-07-31 21:16:31 +03:00
committed by GitHub
20 changed files with 925 additions and 724 deletions

View File

@@ -147,6 +147,7 @@ if (BUILD_TESTS)
add_sdcv_shell_test(t_only_data_dir)
add_sdcv_shell_test(t_synonyms)
add_sdcv_shell_test(t_json)
add_sdcv_shell_test(t_exact)
add_sdcv_shell_test(t_interactive)
add_sdcv_shell_test(t_utf8output)
add_sdcv_shell_test(t_utf8input)

View File

@@ -9,82 +9,92 @@ sdcv \- console version of StarDict program
[list of words]
.SH DESCRIPTION
.I sdcv
is simple, cross-platform text-base utility
for work with dictionaries in StarDict's format.
The word from "list of words" may be string
with leading '/' for using Fuzzy search algorithm,
with leading '|' for using full-text search,
string may contain '?' and '*' for using regexp search.
It work in interactive and not interactive mode.
is a simple, cross-platform text-based utility
for working with dictionaries in StarDict format.
Each word from "list of words" may be a string
with a leading '/' for using a Fuzzy search algorithm,
with a leading '|' for using full-text search,
and the string may contain '?' and '*' for regexp search.
It works in interactive and non-interactive mode.
To exit from interactive mode press Ctrl+D.
In interactive mode,
if sdcv was compiled with readline library support,
you can use UP and DOWN keys to work through history.
you can use the UP and DOWN keys to cycle through history.
.SH OPTIONS
.TP 8
.B "\-h \-\-help"
display help message and exit
Display help message and exit
.TP 8
.B "\-v \-\-verbose"
display version and exit
Display version and exit
.TP 8
.B "\-l \-\-list\-dicts"
display list of available dictionaries and exit
Display list of available dictionaries and exit
.TP 8
.B "\-u \-\-use\-dict filename"
for search use only dictionary with this bookname
For search use only dictionary with this bookname
.TP 8
.B "\-n \-\-non\-interactive"
for use in scripts
For use in scripts
.TP 8
.B "\-x \-\-only\-data\-dir"
For use in scripts: only use the dictionaries in data-dir, do not search in user and system directories
.TP 8
.B "\-e \-\-exact\-search"
Do not fuzzy-search for similar words, only return exact matches
.TP 8
.B "\-j \-\-json"
Print the results of list-dicts and searches as json, not as plain text.
For use in automatically processing the results of a dictionary lookup.
.TP 8
.B "\-\-utf8\-output"
Force sdcv not use conversation to locale charset, output in utf8
Force sdcv to not convert to locale charset, output in utf8
.TP 8
.B "\-\-utf8\-input"
Force sdcv not use conversation from locale charset, suppose that
input in utf8
Force sdcv to not convert from locale charset, assume that
input is in utf8
.TP 8
.B "\-\-data\-dir path/to/directory"
Use this directory as path to stardict data directory. This is mean that
sdcv search dictionaries in data-dir/dic directory.
Use this directory as the path to the stardict data directory. This means that
sdcv searches for dictionaries in data-dir/dic directory.
.TP 8
.B "\-\-color"
Use ANSI escape code for colorize sdcv output
Use ANSI escape codes for colorizing sdcv output (does not work with json output).
.SH FILES
.TP
/usr/share/stardict/dic
/usr/share/stardict/dic
.TP
$(HOME)/.stardict/dic
Place, where sdcv expect to find dictionaries.
Instead of /usr/share/stardict/dic you can use everything
that you want, just set STARDICT_DATA_DIR environment variable.
Place where sdcv expects to find dictionaries.
Instead of /usr/share/stardict/dic you can use any directory
you want, just set the STARDICT_DATA_DIR environment variable.
For example, if you have dictionaries in /mnt/data/stardict-dicts/dic,
set STARDICT_DATA_DIR to /mnt/data/stardict-dicts.
.TP
$(HOME)/.sdcv_history
This file include last $(SDCV_HISTSIZE) words, which you seek with sdcv.
SDCV use this file only if it was compiled with readline library support.
This file includes the last $(SDCV_HISTSIZE) words, which you sought with sdcv.
SDCV uses this file only if it was compiled with readline library support.
.TP
$(HOME)/.sdcv_ordering
This is a text file containing one dictionary bookname per line.
It specify in which order results of search should be shown.
It specifies in which order the results of a search should be shown.
.SH ENVIRONMENT
Environment Variables Used By \fIsdcv\fR:
.TP 20
.B STARDICT_DATA_DIR
If set, sdcv use this variable as data directory, this is mean that sdcv
search dictionaries in $\fBSTARDICT_DATA_DIR\fR\\dic
If set, sdcv uses this variable as the data directory, this means that sdcv
searches dictionaries in $\fBSTARDICT_DATA_DIR\fR\\dic
.TP 20
.B SDCV_HISTSIZE
If set, sdcv wrote in $(HOME)/.sdcv_history only last $(SDCV_HISTSIZE) words,
which you seek using sdcv. If it is not set, then last 2000 words saved in $(HOME)/.sdcv_history.
If set, sdcv writes in $(HOME)/.sdcv_history the last $(SDCV_HISTSIZE) words,
which you look up using sdcv. If it is not set, then the last 2000 words are saved in $(HOME)/.sdcv_history.
.TP 20
.B SDCV_PAGER
If SDCV_PAGER is set, its value is used as the name of the program
to use to display the dictionary's article.
If SDCV_PAGER is set, its value is used as the name of the program
to use to display the dictionary article.
.SH BUGS
Email bug reports to dushistov at mail dot ru. Be sure to include the word
"sdcv" somewhere in the "Subject:" field.

188
po/cs.po
View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.4.2\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2008-09-24 10:42+0200\n"
"Last-Translator: Michal Čihař <michal@cihar.com>\n"
"Language-Team: Czech <cs@li.org>\n"
@@ -16,102 +16,25 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
#: src/sdcv.cpp:108
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version zobrazí informace o verzi a skončí\n"
#: src/sdcv.cpp:110
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr "-l, --list-dicts zobrazí seznam dostupných slovníků a skončí\n"
#: src/sdcv.cpp:112
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict jméno vyhledávat jen v zadaném slovníku\n"
#: src/sdcv.cpp:113
msgid "bookname"
msgstr ""
#: src/sdcv.cpp:115
msgid "for use in scripts"
msgstr ""
#: src/sdcv.cpp:117
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output výstup musí být v utf8\n"
#: src/sdcv.cpp:119
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input vstup musí být v utf8\n"
#: src/sdcv.cpp:121
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir cesta/někam použít tento adresář jako cestu ke slovníkům "
"stardict\n"
#: src/sdcv.cpp:122
msgid "path/to/dir"
msgstr ""
#: src/sdcv.cpp:129
msgid " words"
msgstr ""
#: src/sdcv.cpp:135
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: src/sdcv.cpp:141
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Konzolová verze Stardictu, verze %s\n"
#: src/sdcv.cpp:170
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "Jméno slovníku Počet slov\n"
#: src/sdcv.cpp:192
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir selhalo: %s\n"
#: src/sdcv.cpp:208
msgid "Enter word or phrase: "
msgstr "Zadejte slovo nebo frázi: "
#: src/sdcv.cpp:216
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Nebyla zadáno nic k přeložení.\n"
#: src/libwrapper.cpp:248
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr "popen selhalo"
#: src/libwrapper.cpp:285 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "Nepodařilo se převést %s do utf8.\n"
#: src/libwrapper.cpp:342 src/libwrapper.cpp:370
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, fuzzy, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "Nalezeno %d záznamů podobných %s.\n"
#: src/libwrapper.cpp:356
#: ../src/libwrapper.cpp:410
msgid "Your choice[-1 to abort]: "
msgstr "Vaše volba [-1 pro ukončení]: "
#: src/libwrapper.cpp:365
#: ../src/libwrapper.cpp:419
#, fuzzy, c-format
msgid ""
"Invalid choice.\n"
@@ -120,12 +43,107 @@ msgstr ""
"Chybná volba.\n"
"Musí být mezi 0 a %d nebo -1.\n"
#: src/libwrapper.cpp:381
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "Nic podobného %s nenalezeno, promiň :(\n"
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version zobrazí informace o verzi a skončí\n"
#: ../src/sdcv.cpp:90
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr "-l, --list-dicts zobrazí seznam dostupných slovníků a skončí\n"
#: ../src/sdcv.cpp:92
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict jméno vyhledávat jen v zadaném slovníku\n"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output výstup musí být v utf8\n"
#: ../src/sdcv.cpp:103
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input vstup musí být v utf8\n"
#: ../src/sdcv.cpp:105
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir cesta/někam použít tento adresář jako cestu ke slovníkům "
"stardict\n"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Konzolová verze Stardictu, verze %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir selhalo: %s\n"
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "Zadejte slovo nebo frázi: "
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Nebyla zadáno nic k přeložení.\n"
#: ../src/sdcv.cpp:237
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "Jméno slovníku Počet slov\n"
#: ../src/utils.cpp:48
#, fuzzy, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "Nepodařilo se převést %s do utf8.\n"

198
po/fr.po
View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.4.2\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2009-06-15 23:20+0800\n"
"Language-Team: Vincent Petry <PVince81@yahoo.fr>\n"
"Language: \n"
@@ -18,107 +18,25 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/sdcv.cpp:108
#, fuzzy
msgid "display version information and exit"
msgstr ""
"-v, --version afficher les informations de version et sortir\n"
#: src/sdcv.cpp:110
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr ""
"-l, --list-dicts afficher la liste des dictionnaires disponibles et "
"sortir\n"
#: src/sdcv.cpp:112
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr ""
"-u, --use-dict nom_dict pour chercher seulement en utilisant le "
"dictionnaire spécifié\n"
#: src/sdcv.cpp:113
msgid "bookname"
msgstr ""
#: src/sdcv.cpp:115
msgid "for use in scripts"
msgstr ""
#: src/sdcv.cpp:117
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output force la sortie au format utf8\n"
#: src/sdcv.cpp:119
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input force l'entrée de sdcv au format utf8\n"
#: src/sdcv.cpp:121
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir chemin utiliser ce chemin pour trouver les données de "
"stardict\n"
#: src/sdcv.cpp:122
msgid "path/to/dir"
msgstr ""
#: src/sdcv.cpp:129
msgid " words"
msgstr ""
#: src/sdcv.cpp:135
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: src/sdcv.cpp:141
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Version console de Stardict, version %s\n"
#: src/sdcv.cpp:170
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "Nom dictionnaire Nombre de mots\n"
#: src/sdcv.cpp:192
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "Échec de g_mkdir : %s\n"
#: src/sdcv.cpp:208
msgid "Enter word or phrase: "
msgstr "Entrez un mot ou une phrase: "
#: src/sdcv.cpp:216
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Il n'y a pas de mots/phrases à traduire.\n"
#: src/libwrapper.cpp:248
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr "Échec de popen"
#: src/libwrapper.cpp:285 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "Ne peut convertir %s au format utf8.\n"
#: src/libwrapper.cpp:342 src/libwrapper.cpp:370
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, fuzzy, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "Trouvé %d éléments similaires à %s.\n"
#: src/libwrapper.cpp:356
#: ../src/libwrapper.cpp:410
msgid "Your choice[-1 to abort]: "
msgstr "Votre choix[-1 pour abandonner] : "
#: src/libwrapper.cpp:365
#: ../src/libwrapper.cpp:419
#, fuzzy, c-format
msgid ""
"Invalid choice.\n"
@@ -127,12 +45,112 @@ msgstr ""
"Selection invalide.\n"
"Veuillez choisir un nombre entre 0 et %d, ou -1.\n"
#: src/libwrapper.cpp:381
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "Aucun mot/phrase similaire à %s, désolé :(\n"
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
#, fuzzy
msgid "display version information and exit"
msgstr ""
"-v, --version afficher les informations de version et sortir\n"
#: ../src/sdcv.cpp:90
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr ""
"-l, --list-dicts afficher la liste des dictionnaires disponibles et "
"sortir\n"
#: ../src/sdcv.cpp:92
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr ""
"-u, --use-dict nom_dict pour chercher seulement en utilisant le "
"dictionnaire spécifié\n"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output force la sortie au format utf8\n"
#: ../src/sdcv.cpp:103
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input force l'entrée de sdcv au format utf8\n"
#: ../src/sdcv.cpp:105
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir chemin utiliser ce chemin pour trouver les données de "
"stardict\n"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Version console de Stardict, version %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "Échec de g_mkdir : %s\n"
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "Entrez un mot ou une phrase: "
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Il n'y a pas de mots/phrases à traduire.\n"
#: ../src/sdcv.cpp:237
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "Nom dictionnaire Nombre de mots\n"
#: ../src/utils.cpp:48
#, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "Ne peut pas convertir %s dans la locale courante.\n"

178
po/ru.po
View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.5\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2013-07-07 18:49+0400\n"
"Last-Translator: Evgeniy Dushistov <dushistov@mail.ru>\n"
"Language-Team: Russian <ru@li.org>\n"
@@ -19,99 +19,25 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/sdcv.cpp:76
msgid "display version information and exit"
msgstr "показать номер версии и завершить работу"
#: src/sdcv.cpp:78
msgid "display list of available dictionaries and exit"
msgstr "показать список доступных словарей и завершить работу"
#: src/sdcv.cpp:84
msgid "for search use only dictionary with this bookname"
msgstr "для поиска использовать только этот словарь с таким именем"
#: src/sdcv.cpp:85
msgid "bookname"
msgstr "имя_словаря"
#: src/sdcv.cpp:87
msgid "for use in scripts"
msgstr "для использования в скриптах"
#: src/sdcv.cpp:89
msgid "output must be in utf8"
msgstr "вывод программы должен быть в utf8"
#: src/sdcv.cpp:91
msgid "input of sdcv in utf8"
msgstr "ввод программы в utf8"
#: src/sdcv.cpp:93
msgid "use this directory as path to stardict data directory"
msgstr ""
"использовать эту директорию в качестве пути к \"stardict data\" директории"
#: src/sdcv.cpp:94
msgid "path/to/dir"
msgstr "путь/до/директории"
#: src/sdcv.cpp:96
msgid "colorize the output"
msgstr "раскрашивать вывод в разные цвета"
#: src/sdcv.cpp:101
msgid " words"
msgstr "слова"
#: src/sdcv.cpp:107
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr "Неправильный аргумент командой строки: %s\n"
#: src/sdcv.cpp:113
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Консольная версия StarDict, версия %s\n"
#: src/sdcv.cpp:139
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "Название словаря Количество слов\n"
#: src/sdcv.cpp:174
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir завершился с ошибкой: %s\n"
#: src/sdcv.cpp:189
msgid "Enter word or phrase: "
msgstr "Введите слово или фразу: "
#: src/sdcv.cpp:197
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Не задано слова/фразы для перевода.\n"
#: src/libwrapper.cpp:280
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr "функция popen завершилась с ошибкой"
#: src/libwrapper.cpp:317 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "Не могу преобразовать %s в utf8.\n"
#: src/libwrapper.cpp:371 src/libwrapper.cpp:402
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "Найдено %zu слов, похожих на %s.\n"
#: src/libwrapper.cpp:388
#: ../src/libwrapper.cpp:410
msgid "Your choice[-1 to abort]: "
msgstr "Ваш выбор[-1 - отмена]: "
#: src/libwrapper.cpp:397
#: ../src/libwrapper.cpp:419
#, c-format
msgid ""
"Invalid choice.\n"
@@ -120,12 +46,100 @@ msgstr ""
"Неправильный выбор.\n"
"Должно быть от 0 до %zu или -1.\n"
#: src/libwrapper.cpp:413
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "Ничего похожего на %s, извините :(\n"
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
msgid "display version information and exit"
msgstr "показать номер версии и завершить работу"
#: ../src/sdcv.cpp:90
msgid "display list of available dictionaries and exit"
msgstr "показать список доступных словарей и завершить работу"
#: ../src/sdcv.cpp:92
msgid "for search use only dictionary with this bookname"
msgstr "для поиска использовать только этот словарь с таким именем"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr "имя_словаря"
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr "для использования в скриптах"
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
msgid "output must be in utf8"
msgstr "вывод программы должен быть в utf8"
#: ../src/sdcv.cpp:103
msgid "input of sdcv in utf8"
msgstr "ввод программы в utf8"
#: ../src/sdcv.cpp:105
msgid "use this directory as path to stardict data directory"
msgstr ""
"использовать эту директорию в качестве пути к \"stardict data\" директории"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr "путь/до/директории"
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr "раскрашивать вывод в разные цвета"
#: ../src/sdcv.cpp:115
msgid " words"
msgstr "слова"
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr "Неправильный аргумент командой строки: %s\n"
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Консольная версия StarDict, версия %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir завершился с ошибкой: %s\n"
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "Введите слово или фразу: "
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Не задано слова/фразы для перевода.\n"
#: ../src/sdcv.cpp:237
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "Название словаря Количество слов\n"
#: ../src/utils.cpp:48
#, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "Не могу преобразовать %s в локальную кодировку.\n"

View File

@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.5\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -15,110 +15,124 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/sdcv.cpp:76
msgid "display version information and exit"
msgstr ""
#: src/sdcv.cpp:78
msgid "display list of available dictionaries and exit"
msgstr ""
#: src/sdcv.cpp:84
msgid "for search use only dictionary with this bookname"
msgstr ""
#: src/sdcv.cpp:85
msgid "bookname"
msgstr ""
#: src/sdcv.cpp:87
msgid "for use in scripts"
msgstr ""
#: src/sdcv.cpp:89
msgid "output must be in utf8"
msgstr ""
#: src/sdcv.cpp:91
msgid "input of sdcv in utf8"
msgstr ""
#: src/sdcv.cpp:93
msgid "use this directory as path to stardict data directory"
msgstr ""
#: src/sdcv.cpp:94
msgid "path/to/dir"
msgstr ""
#: src/sdcv.cpp:96
msgid "colorize the output"
msgstr ""
#: src/sdcv.cpp:101
msgid " words"
msgstr ""
#: src/sdcv.cpp:107
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: src/sdcv.cpp:113
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr ""
#: src/sdcv.cpp:139
#, c-format
msgid "Dictionary's name Word count\n"
msgstr ""
#: src/sdcv.cpp:174
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr ""
#: src/sdcv.cpp:189
msgid "Enter word or phrase: "
msgstr ""
#: src/sdcv.cpp:197
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr ""
#: src/libwrapper.cpp:280
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr ""
#: src/libwrapper.cpp:317 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr ""
#: src/libwrapper.cpp:371 src/libwrapper.cpp:402
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr ""
#: src/libwrapper.cpp:388
#: ../src/libwrapper.cpp:410
msgid "Your choice[-1 to abort]: "
msgstr ""
#: src/libwrapper.cpp:397
#: ../src/libwrapper.cpp:419
#, c-format
msgid ""
"Invalid choice.\n"
"It must be from 0 to %zu or -1.\n"
msgstr ""
#: src/libwrapper.cpp:413
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr ""
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
msgid "display version information and exit"
msgstr ""
#: ../src/sdcv.cpp:90
msgid "display list of available dictionaries and exit"
msgstr ""
#: ../src/sdcv.cpp:92
msgid "for search use only dictionary with this bookname"
msgstr ""
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
msgid "output must be in utf8"
msgstr ""
#: ../src/sdcv.cpp:103
msgid "input of sdcv in utf8"
msgstr ""
#: ../src/sdcv.cpp:105
msgid "use this directory as path to stardict data directory"
msgstr ""
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr ""
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr ""
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr ""
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr ""
#: ../src/sdcv.cpp:237
#, c-format
msgid "Dictionary's name Word count\n"
msgstr ""
#: ../src/utils.cpp:48
#, c-format
msgid "Can not convert %s to current locale.\n"
msgstr ""

190
po/sk.po
View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.3.2\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2007-09-11 00:22+0100\n"
"Last-Translator: Ivan Masár <helix84@centrum.sk>\n"
"Language-Team: Slovak <sk-i18n@lists.linux.sk>\n"
@@ -18,104 +18,26 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/sdcv.cpp:108
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version zobrazí informácie o verzii a skončí\n"
#: src/sdcv.cpp:110
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr ""
"-l, --list-dicts zobrazí zoznam dostupných slovníkov a skončí\n"
#: src/sdcv.cpp:112
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict názov použiť pre hľadanie iba zvolený slovník\n"
#: src/sdcv.cpp:113
msgid "bookname"
msgstr ""
#: src/sdcv.cpp:115
msgid "for use in scripts"
msgstr ""
#: src/sdcv.cpp:117
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output výstup musí byť v utf8\n"
#: src/sdcv.cpp:119
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input vstup pre sdcv je v utf8\n"
#: src/sdcv.cpp:121
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir path/to/dir použiť tento priečinok ako cestu pre stardict "
"dátový priečinok\n"
#: src/sdcv.cpp:122
msgid "path/to/dir"
msgstr ""
#: src/sdcv.cpp:129
msgid " words"
msgstr ""
#: src/sdcv.cpp:135
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: src/sdcv.cpp:141
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Konzolová verzia StarDict, verzia %s\n"
#: src/sdcv.cpp:170
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "názov slovníka počet slov\n"
#: src/sdcv.cpp:192
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir zlyhalo: %s\n"
#: src/sdcv.cpp:208
msgid "Enter word or phrase: "
msgstr "Vložte slovo alebo frázu: "
#: src/sdcv.cpp:216
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Nie je čo preložiť.\n"
#: src/libwrapper.cpp:248
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr "popen zlyhalo"
#: src/libwrapper.cpp:285 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "nie je možné konvertovať %s na utf8.\n"
#: src/libwrapper.cpp:342 src/libwrapper.cpp:370
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, fuzzy, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "Nájdené %d položiek, podobných %s,\n"
#: src/libwrapper.cpp:356
#: ../src/libwrapper.cpp:410
#, fuzzy
msgid "Your choice[-1 to abort]: "
msgstr "Vaša voľba[-1 zruší]: "
#: src/libwrapper.cpp:365
#: ../src/libwrapper.cpp:419
#, fuzzy, c-format
msgid ""
"Invalid choice.\n"
@@ -124,12 +46,108 @@ msgstr ""
"Neplatná voľba.\n"
"Musí byť od 0 do %d alebo -1.\n"
#: src/libwrapper.cpp:381
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "Ľutujem, nič sa nepodobá na %s :(\n"
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version zobrazí informácie o verzii a skončí\n"
#: ../src/sdcv.cpp:90
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr ""
"-l, --list-dicts zobrazí zoznam dostupných slovníkov a skončí\n"
#: ../src/sdcv.cpp:92
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict názov použiť pre hľadanie iba zvolený slovník\n"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output výstup musí byť v utf8\n"
#: ../src/sdcv.cpp:103
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input vstup pre sdcv je v utf8\n"
#: ../src/sdcv.cpp:105
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir path/to/dir použiť tento priečinok ako cestu pre stardict "
"dátový priečinok\n"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Konzolová verzia StarDict, verzia %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir zlyhalo: %s\n"
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "Vložte slovo alebo frázu: "
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Nie je čo preložiť.\n"
#: ../src/sdcv.cpp:237
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "názov slovníka počet slov\n"
#: ../src/utils.cpp:48
#, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "Nie je možné konvertovať %s na aktuálne locale.\n"

194
po/uk.po
View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.3\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2004-12-14 17:54+0300\n"
"Last-Translator: <dubyk@lsl.lviv.ua>\n"
"Language-Team: Ukrainian <dubyk@lsl.lviv.ua>\n"
@@ -19,106 +19,26 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: src/sdcv.cpp:108
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version показати номер версії і завершити роботу\n"
#: src/sdcv.cpp:110
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr ""
"-l, --list-dicts показати список доступних словників і завершити "
"роботу\n"
#: src/sdcv.cpp:112
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr ""
"-u, --use-dict ім`я словника для пошуку використовувати лише цей словник\n"
#: src/sdcv.cpp:113
msgid "bookname"
msgstr ""
#: src/sdcv.cpp:115
msgid "for use in scripts"
msgstr ""
#: src/sdcv.cpp:117
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output вивід програми повинен бути в utf8\n"
#: src/sdcv.cpp:119
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input ввід програми в utf8\n"
#: src/sdcv.cpp:121
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir тека використовувати цю теку як шлях до stardict data "
"directory\n"
#: src/sdcv.cpp:122
msgid "path/to/dir"
msgstr ""
#: src/sdcv.cpp:129
msgid " words"
msgstr ""
#: src/sdcv.cpp:135
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: src/sdcv.cpp:141
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Консольна версія Зоряного словника [Stardict], номер версії %s\n"
#: src/sdcv.cpp:170
#, fuzzy, c-format
msgid "Dictionary's name Word count\n"
msgstr "назва словника кількість слів\n"
#: src/sdcv.cpp:192
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr ""
#: src/sdcv.cpp:208
msgid "Enter word or phrase: "
msgstr "ВведЁть слово або фразу: "
#: src/sdcv.cpp:216
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Не задано слова/фрази для перекладу.\n"
#: src/libwrapper.cpp:248
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr ""
#: src/libwrapper.cpp:285 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "Не можу перетворити %s у utf8.\n"
#: src/libwrapper.cpp:342 src/libwrapper.cpp:370
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, fuzzy, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "Знайдено %d слів, схожих на %s.\n"
#: src/libwrapper.cpp:356
#: ../src/libwrapper.cpp:410
#, fuzzy
msgid "Your choice[-1 to abort]: "
msgstr "Ваш вибір: "
#: src/libwrapper.cpp:365
#: ../src/libwrapper.cpp:419
#, fuzzy, c-format
msgid ""
"Invalid choice.\n"
@@ -127,12 +47,110 @@ msgstr ""
"Неправильний вибір.\n"
"Повинно бути від 0 до %d.\n"
#: src/libwrapper.cpp:381
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "Нічого схожого на %s, даруйте :(\n"
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version показати номер версії і завершити роботу\n"
#: ../src/sdcv.cpp:90
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr ""
"-l, --list-dicts показати список доступних словників і завершити "
"роботу\n"
#: ../src/sdcv.cpp:92
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr ""
"-u, --use-dict ім`я словника для пошуку використовувати лише цей словник\n"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output вивід програми повинен бути в utf8\n"
#: ../src/sdcv.cpp:103
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input ввід програми в utf8\n"
#: ../src/sdcv.cpp:105
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr ""
"--data-dir тека використовувати цю теку як шлях до stardict data "
"directory\n"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Консольна версія Зоряного словника [Stardict], номер версії %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr ""
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "ВведЁть слово або фразу: "
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "Не задано слова/фрази для перекладу.\n"
#: ../src/sdcv.cpp:237
#, fuzzy, c-format
msgid "Dictionary's name Word count\n"
msgstr "назва словника кількість слів\n"
#: ../src/utils.cpp:48
#, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "Не можу перетворити %s у локальне кодування.\n"

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.3\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2008-09-24 10:54+0200\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2005-1-17 00:58+0800\n"
"Last-Translator: Cai Qian <caiqian@gnome.org>\n"
"Language-Team: Simplified Chinese\n"
@@ -15,101 +15,26 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/sdcv.cpp:108
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version 显示版本信息并退出\n"
#: src/sdcv.cpp:110
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr "-l, --list-dicts 显示可用的字典列表并退出\n"
#: src/sdcv.cpp:112
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict 字典名 只使用指定的字典进行单词搜索\n"
#: src/sdcv.cpp:113
msgid "bookname"
msgstr ""
#: src/sdcv.cpp:115
msgid "for use in scripts"
msgstr ""
#: src/sdcv.cpp:117
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output 输出必须是 UTF-8\n"
#: src/sdcv.cpp:119
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input sdcv 的输入为 UTF-8\n"
#: src/sdcv.cpp:121
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr "--data-dir 目录路径 指定 Stardict 数据所在目录的路径\n"
#: src/sdcv.cpp:122
msgid "path/to/dir"
msgstr ""
#: src/sdcv.cpp:129
msgid " words"
msgstr ""
#: src/sdcv.cpp:135
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: src/sdcv.cpp:141
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Stardict 的控制台版本,版本为 %s\n"
#: src/sdcv.cpp:170
#, fuzzy, c-format
msgid "Dictionary's name Word count\n"
msgstr "字典名 单词量\n"
#: src/sdcv.cpp:192
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr ""
#: src/sdcv.cpp:208
msgid "Enter word or phrase: "
msgstr "请输入单词或短语:"
#: src/sdcv.cpp:216
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "没有供翻译的单词或短语。\n"
#: src/libwrapper.cpp:248
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr ""
#: src/libwrapper.cpp:285 src/utils.cpp:67
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "无法将 %s 转换为 UTF-8。\n"
#: src/libwrapper.cpp:342 src/libwrapper.cpp:370
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, fuzzy, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "发现 %d 条记录和 %s 相似。\n"
#: src/libwrapper.cpp:356
#: ../src/libwrapper.cpp:410
#, fuzzy
msgid "Your choice[-1 to abort]: "
msgstr "您的选择为:"
#: src/libwrapper.cpp:365
#: ../src/libwrapper.cpp:419
#, fuzzy, c-format
msgid ""
"Invalid choice.\n"
@@ -118,12 +43,105 @@ msgstr ""
"无效的选择。\n"
"必须是 0 到 %d。\n"
#: src/libwrapper.cpp:381
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "对不起,没有发现和 %s 相似的 :(\n"
#: src/utils.cpp:45
#: ../src/sdcv.cpp:88
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version 显示版本信息并退出\n"
#: ../src/sdcv.cpp:90
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr "-l, --list-dicts 显示可用的字典列表并退出\n"
#: ../src/sdcv.cpp:92
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict 字典名 只使用指定的字典进行单词搜索\n"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output 输出必须是 UTF-8\n"
#: ../src/sdcv.cpp:103
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input sdcv 的输入为 UTF-8\n"
#: ../src/sdcv.cpp:105
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr "--data-dir 目录路径 指定 Stardict 数据所在目录的路径\n"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Stardict 的控制台版本,版本为 %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr ""
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "请输入单词或短语:"
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "没有供翻译的单词或短语。\n"
#: ../src/sdcv.cpp:237
#, fuzzy, c-format
msgid "Dictionary's name Word count\n"
msgstr "字典名 单词量\n"
#: ../src/utils.cpp:48
#, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "无法将 %s 转换为当前 Locale。\n"

View File

@@ -8,122 +8,158 @@ msgid ""
msgstr ""
"Project-Id-Version: sdcv 0.4.2\n"
"Report-Msgid-Bugs-To: dushistov@mail.ru\n"
"POT-Creation-Date: 2006-04-24 15:18+0400\n"
"POT-Creation-Date: 2017-07-31 19:18+0200\n"
"PO-Revision-Date: 2013-06-12 14:11+0800\n"
"Last-Translator: Wei-Lun Chao <bluebat@member.fsf.org>\n"
"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: src/sdcv.cpp:127
#, c-format
msgid ""
"Unknown option.\n"
"Try '%s --help' for more information.\n"
msgstr ""
"不明選項。\n"
"更多資訊請看 '%s --help'。\n"
#: src/sdcv.cpp:134
#, c-format
msgid "Usage: %s [OPTIONS] words\n"
msgstr "用法:%s [選項] 單字…\n"
#: src/sdcv.cpp:135
#, c-format
msgid "-h, --help display this help and exit\n"
msgstr "-h, --help 顯示本輔助並離開\n"
#: src/sdcv.cpp:136
#, c-format
msgid "-v, --version display version information and exit\n"
msgstr "-v, --version 顯示版本資訊並離開\n"
#: src/sdcv.cpp:137
#, c-format
msgid "-l, --list-dicts display list of available dictionaries and exit\n"
msgstr "-l, --list-dicts 顯示可用的字典清單並離開\n"
#: src/sdcv.cpp:138
#, c-format
msgid "-u, --use-dict bookname for search use only dictionary with this bookname\n"
msgstr "-u, --use-dict 字典名 只使用指定的字典進行單字搜尋\n"
#: src/sdcv.cpp:139
#, c-format
msgid "-n, --non-interactive for use in scripts\n"
msgstr "-n, --non-interactive 在指令稿中使用\n"
#: src/sdcv.cpp:140
#, c-format
msgid "--utf8-output output must be in utf8\n"
msgstr "--utf8-output 輸出必須是 UTF-8\n"
#: src/sdcv.cpp:141
#, c-format
msgid "--utf8-input input of sdcv in utf8\n"
msgstr "--utf8-input sdcv 的輸入為 UTF-8\n"
#: src/sdcv.cpp:142
#, c-format
msgid "--data-dir path/to/dir use this directory as path to stardict data directory\n"
msgstr "--data-dir 目錄路徑 指定 Stardict 資料所在目錄的路徑\n"
#: src/sdcv.cpp:148
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Stardict 的主控臺版本,版本為 %s\n"
#: src/sdcv.cpp:169
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "字典名稱 單字數量\n"
#: src/sdcv.cpp:191
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir 失敗:%s\n"
#: src/sdcv.cpp:207
msgid "Enter word or phrase: "
msgstr "請輸入單字或片語:"
#: src/sdcv.cpp:215
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "沒有可供翻譯的單字或片語。\n"
#: src/libwrapper.cpp:245
#: ../src/libwrapper.cpp:297
msgid "popen failed"
msgstr "popen 失敗"
#: src/libwrapper.cpp:282
#: ../src/libwrapper.cpp:334
#, c-format
msgid "Can not convert %s to utf8.\n"
msgstr "無法將 %s 轉換為 UTF-8。\n"
#: src/libwrapper.cpp:339 src/libwrapper.cpp:371
#, c-format
msgid "Found %d items, similar to %s.\n"
#: ../src/libwrapper.cpp:393 ../src/libwrapper.cpp:425
#, fuzzy, c-format
msgid "Found %zu items, similar to %s.\n"
msgstr "找到 %d 項紀錄和 %s 相似。\n"
#: src/libwrapper.cpp:352
#, c-format
#: ../src/libwrapper.cpp:410
msgid "Your choice[-1 to abort]: "
msgstr "您的選擇是[-1 表示放棄]"
#: src/libwrapper.cpp:366
#, c-format
#: ../src/libwrapper.cpp:419
#, fuzzy, c-format
msgid ""
"Invalid choise.\n"
"It must be from 0 to %d or -1.\n"
"Invalid choice.\n"
"It must be from 0 to %zu or -1.\n"
msgstr ""
"無效的選擇。\n"
"必須是 0 到 %d 之間或 -1。\n"
#: src/libwrapper.cpp:382
#: ../src/libwrapper.cpp:436
#, c-format
msgid "Nothing similar to %s, sorry :(\n"
msgstr "抱歉,沒有和 %s 相似者 :(\n"
#: ../src/sdcv.cpp:88
#, fuzzy
msgid "display version information and exit"
msgstr "-v, --version 顯示版本資訊並離開\n"
#: ../src/sdcv.cpp:90
#, fuzzy
msgid "display list of available dictionaries and exit"
msgstr "-l, --list-dicts 顯示可用的字典清單並離開\n"
#: ../src/sdcv.cpp:92
#, fuzzy
msgid "for search use only dictionary with this bookname"
msgstr "-u, --use-dict 字典名 只使用指定的字典進行單字搜尋\n"
#: ../src/sdcv.cpp:93
msgid "bookname"
msgstr ""
#: ../src/sdcv.cpp:95
msgid "for use in scripts"
msgstr ""
#: ../src/sdcv.cpp:97
msgid "print the result formatted as JSON."
msgstr ""
#: ../src/sdcv.cpp:99
msgid "do not fuzzy-search for similar words, only return exact matches."
msgstr ""
#: ../src/sdcv.cpp:101
#, fuzzy
msgid "output must be in utf8"
msgstr "--utf8-output 輸出必須是 UTF-8\n"
#: ../src/sdcv.cpp:103
#, fuzzy
msgid "input of sdcv in utf8"
msgstr "--utf8-input sdcv 的輸入為 UTF-8\n"
#: ../src/sdcv.cpp:105
#, fuzzy
msgid "use this directory as path to stardict data directory"
msgstr "--data-dir 目錄路徑 指定 Stardict 資料所在目錄的路徑\n"
#: ../src/sdcv.cpp:106
msgid "path/to/dir"
msgstr ""
#: ../src/sdcv.cpp:108
msgid ""
"only use the dictionaries in data-dir, do not search in user and system "
"directories"
msgstr ""
#: ../src/sdcv.cpp:110
msgid "colorize the output"
msgstr ""
#: ../src/sdcv.cpp:115
msgid " words"
msgstr ""
#: ../src/sdcv.cpp:121
#, c-format
msgid "Invalid command line arguments: %s\n"
msgstr ""
#: ../src/sdcv.cpp:127
#, c-format
msgid "Console version of Stardict, version %s\n"
msgstr "Stardict 的主控臺版本,版本為 %s\n"
#: ../src/sdcv.cpp:202
#, c-format
msgid "g_mkdir failed: %s\n"
msgstr "g_mkdir 失敗:%s\n"
#: ../src/sdcv.cpp:217
msgid "Enter word or phrase: "
msgstr "請輸入單字或片語:"
#: ../src/sdcv.cpp:225
#, c-format
msgid "There are no words/phrases to translate.\n"
msgstr "沒有可供翻譯的單字或片語。\n"
#: ../src/sdcv.cpp:237
#, c-format
msgid "Dictionary's name Word count\n"
msgstr "字典名稱 單字數量\n"
#: ../src/utils.cpp:48
#, fuzzy, c-format
msgid "Can not convert %s to current locale.\n"
msgstr "無法將 %s 轉換為 UTF-8。\n"
#~ msgid ""
#~ "Unknown option.\n"
#~ "Try '%s --help' for more information.\n"
#~ msgstr ""
#~ "不明選項。\n"
#~ "更多資訊請看 '%s --help'。\n"
#~ msgid "Usage: %s [OPTIONS] words\n"
#~ msgstr "用法:%s [選項] 單字…\n"
#~ msgid "-h, --help display this help and exit\n"
#~ msgstr "-h, --help 顯示本輔助並離開\n"
#~ msgid "-n, --non-interactive for use in scripts\n"
#~ msgstr "-n, --non-interactive 在指令稿中使用\n"

View File

@@ -350,7 +350,7 @@ bool Library::process_phrase(const char *loc_str, IReadLine &io, bool force)
break;
case qtSIMPLE:
SimpleLookup(get_impl(str), res_list);
if (res_list.empty())
if (res_list.empty() && fuzzy_)
LookupWithFuzzy(get_impl(str), res_list);
break;
case qtDATA:

View File

@@ -25,9 +25,10 @@ typedef std::vector<TSearchResult> TSearchResultList;
//of it
class Library : public Libs {
public:
Library(bool uinput, bool uoutput, bool colorize_output, bool use_json)
Library(bool uinput, bool uoutput, bool colorize_output, bool use_json, bool no_fuzzy)
: utf8_input_(uinput), utf8_output_(uoutput), colorize_output_(colorize_output), json_(use_json) {
setVerbose(!use_json);
setFuzzy(!no_fuzzy);
}
bool process_phrase(const char *loc_str, IReadLine &io, bool force = false);

View File

@@ -76,6 +76,7 @@ int main(int argc, char *argv[]) try {
glib::StrArr use_dict_list;
gboolean non_interactive = FALSE;
gboolean json_output = FALSE;
gboolean no_fuzzy = FALSE;
gboolean utf8_output = FALSE;
gboolean utf8_input = FALSE;
glib::CharStr opt_data_dir;
@@ -94,6 +95,8 @@ int main(int argc, char *argv[]) try {
_("for use in scripts"), nullptr },
{ "json-output", 'j', 0, G_OPTION_ARG_NONE, &json_output,
_("print the result formatted as JSON."), nullptr },
{ "exact-search", 'e', 0, G_OPTION_ARG_NONE, &no_fuzzy,
_("do not fuzzy-search for similar words, only return exact matches."), nullptr },
{ "utf8-output", '0', 0, G_OPTION_ARG_NONE, &utf8_output,
_("output must be in utf8"), nullptr },
{ "utf8-input", '1', 0, G_OPTION_ARG_NONE, &utf8_input,
@@ -199,7 +202,7 @@ int main(int argc, char *argv[]) try {
fprintf(stderr, _("g_mkdir failed: %s\n"), strerror(errno));
}
Library lib(utf8_input, utf8_output, colorize, json_output);
Library lib(utf8_input, utf8_output, colorize, json_output, no_fuzzy);
lib.load(dicts_dir_list, order_list, disable_list);
std::unique_ptr<IReadLine> io(create_readline_object());

View File

@@ -1404,7 +1404,7 @@ bool Libs::LookupSimilarWord(const gchar* sWord, glong & iWordIndex, int iLib)
bool Libs::SimpleLookupWord(const gchar* sWord, glong & iWordIndex, int iLib)
{
bool bFound = oLib[iLib]->Lookup(sWord, iWordIndex);
if (!bFound)
if (!bFound && fuzzy_)
bFound = LookupSimilarWord(sWord, iWordIndex, iLib);
return bFound;
}

View File

@@ -145,6 +145,7 @@ public:
iMaxFuzzyDistance = MAX_FUZZY_DISTANCE; //need to read from cfg.
}
void setVerbose(bool verbose) { verbose_ = verbose; }
void setFuzzy(bool fuzzy) { fuzzy_ = fuzzy; }
~Libs();
Libs(const Libs&) = delete;
Libs& operator=(const Libs&) = delete;
@@ -178,6 +179,8 @@ public:
bool LookupWithFuzzy(const gchar *sWord, gchar *reslist[], gint reslist_size);
gint LookupWithRule(const gchar *sWord, gchar *reslist[]);
bool LookupData(const gchar *sWord, std::vector<gchar *> *reslist);
protected:
bool fuzzy_;
private:
std::vector<Dict *> oLib; // word Libs.
int iMaxFuzzyDistance;

View File

@@ -1,7 +1,7 @@
StarDict's dict ifo file
version=2.4.2
bookname=Test synonyms
wordcount=1
wordcount=2
synwordcount=2
idxfilesize=13
idxfilesize=32
sametypesequence=m

View File

@@ -15,4 +15,9 @@
<![CDATA[result of test]]>
</definition>
</article>
<article><key>testawordy</key>
<definition type="m">
<![CDATA[word that ends in y to test with fuzzy search in -ied]]>
</definition>
</article>
</stardict>

24
tests/t_exact Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
set -e
SDCV="$1"
TEST_DIR="$2"
unset SDCV_PAGER
test_word() {
WORD=$1
EXPECTED=$2
TAG=$3
RES=$($SDCV -e -n --data-dir "$TEST_DIR" -u "Test synonyms" $WORD | grep "$TAG")
if [ "$EXPECTED" != "$RES" ]; then
echo "synonym for $WORD should be '$EXPECTED' but was '$RES'"
exit 1
fi
}
test_word testawordies "Nothing similar to testawordies, sorry :(" "Nothing similar"
test_word testawordy "word that ends in y to test with fuzzy search in -ied" "fuzzy"
exit 0