From: レミリア・スカーレット Date: Sun, 9 Jun 2024 05:50:49 +0000 (+0900) Subject: (正しい)英訳 X-Git-Tag: sp-1.3.0~3^2 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=refs%2Fpull%2F18%2Fhead;p=sp.git (正しい)英訳 --- diff --git a/Makefile b/Makefile index 68cb621..85a9e99 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ clean: dist: clean mkdir -p release/src ${NAME}-${VERSION} cp -R LICENSE.txt Makefile README.md CHANGELOG.md \ - ${NAME}-completion.zsh ${NAME}.1 main.c src ${NAME}-${VERSION} + ${NAME}-completion.zsh man main.c src ${NAME}-${VERSION} tar zcfv release/src/${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION} rm -rf ${NAME}-${VERSION} @@ -70,8 +70,12 @@ install: all cp -f ${NAME} ${DESTDIR}${PREFIX}/bin chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME} mkdir -p ${DESTDIR}${MANPREFIX}/man1 - sed "s/VERSION/${VERSION}/g" < ${NAME}.1 > ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}.1 + sed "s/VERSION/${VERSION}/g" < man/${NAME}-en.1 > \ + ${DESTDIR}${MANPREFIX}/man1/${NAME}-en.1 + sed "s/VERSION/${VERSION}/g" < man/${NAME}-jp.1 > \ + ${DESTDIR}${MANPREFIX}/man1/${NAME}-jp.1 + chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}-en.1 + chmod 644 ${DESTDIR}${MANPREFIX}/man1/${NAME}-jp.1 install-zsh: cp sp-completion.zsh ${DESTDIR}${PREFIX}/share/zsh/site-functions/_sp diff --git a/README.md b/README.md index 146487d..30756d7 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,67 @@ # sp シンプルなパスワードマネージャー +Simple Password Manager -## インストールする方法 +## インストールする方法 | Installation ### CRUX ```sh -doas prt-get depinst gpgme gnupg pinentry -doas make install -doas make install-zsh -``` - -又は - -```sh -doas su -cd /etc/ports -wget https://076.moe/repo/crux/suwaports.httpup -echo "prtdir /usr/ports/suwaports" >> /etc/prt-get.conf -ports -u -prt-get depinst sp +doas prt-get depinst gpgme gnupg pinentry bmake +bmake +doas bmake install PREFIX=/usr +doas bmake install-zsh PREFIX=/usr ``` ### Artix ```sh -doas pacman -S base-devel gpgme gnupg pinentry -doas make install -doas make install-zsh +doas pacman -S base-devel gpgme gnupg pinentry bmake +bmake +doas bmake install PREFIX=/usr +doas bmake install-zsh PREFIX=/usr ``` ### OpenBSD ```sh -doas pkg_add gmake gpgme gnupg pinentry -doas gmake install PREFIX=/usr/local -doas gmake install-zsh PREFIX=/usr/local +doas pkg_add gpgme gnupg pinentry +make +doas make install +doas make install-zsh ``` ### FreeBSD ```sh -doas pkg install gmake gpgme gnupg pinentry -doas gmake install PREFIX=/usr/local -doas gmake install-zsh PREFIX=/usr/local +doas pkg install gpgme gnupg pinentry +make +doas make install +doas make install-zsh ``` -## 初期設定 +## 初期設定 | Initial setup 「gpg -k」でGPG鍵IDを確認して、「sp -i [GPG ID]」を実行して下さい。 +Confirm your GPG key ID with "gpg -k", and run "sp -i [GPG ID]". -## 使い方 -### パスワードの作成 -#### 強いパスワードの場合 +## 使い方 | Usage +### パスワードの作成 | Password generation +#### 強いパスワードの場合 | Strong password ```sh $ sp -g 64 nSYGSF2lWGCUsqKCRB_~mZm+spaU 0) { if (fwrite(buffer, 1, (size_t)read_bytes, gpgfile) != (size_t)read_bytes) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to writing password"); + perror("Failed to write password"); else perror("パスワードを書き込みに失敗"); free(gpgpath); cleanup(ctx, key[0], in, out); @@ -296,6 +296,6 @@ void addpass(char *file) { cleanup(ctx, key[0], in, out); if (strncmp(lang, "en", 2) == 0) - puts("I could save the password"); + puts("The password got saved."); else puts("パスワードを保存出来ました"); } diff --git a/src/delpass.c b/src/delpass.c index b70deb6..b20d66a 100644 --- a/src/delpass.c +++ b/src/delpass.c @@ -65,7 +65,7 @@ int delpass(char *file, int force) { char *homedir = getenv("HOME"); if (homedir == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to getting home directory"); + perror("Failed to get home directory"); else perror("ホームディレクトリを受取に失敗"); return -1; } @@ -77,7 +77,7 @@ int delpass(char *file, int force) { char *gpgpathchk = malloc(alllen); if (gpgpathchk == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to allocating memory"); + perror("Failed to allocate memory"); else perror("メモリを割当に失敗"); return -1; } @@ -112,7 +112,7 @@ int delpass(char *file, int force) { // 削除を確認する if (force == 0) { // パスワードの変更の場合、確認は不要 if (strncmp(lang, "en", 2) == 0) - printf("Is it really good if I delete the password '%s'? (y/N): ", file); + printf("Are you sure you want to delete the password '%s'? (y/N): ", file); printf("パスワード「%s」を本当に削除する事が宜しいでしょうか? (y/N): ", file); int confirm = getchar(); if (confirm != 'y' && confirm != 'Y') { @@ -127,7 +127,7 @@ int delpass(char *file, int force) { if (unlink(pwfile) == -1) { if (strncmp(lang, "en", 2) == 0) - perror("Password cannot be delete"); + perror("Password cannot be deleted"); else perror("パスワードを削除出来ませんですた"); return -1; } @@ -173,7 +173,7 @@ int delpass(char *file, int force) { // sp -e の場合、「パスワードを削除しました」って要らない if (force == 1) return 0; - if (strncmp(lang, "en", 2) == 0) puts("Deleted password"); + if (strncmp(lang, "en", 2) == 0) puts("The password got deleted"); else puts("パスワードを削除しました"); return 0; diff --git a/src/genpass.c b/src/genpass.c index b2f5071..bbd4cab 100644 --- a/src/genpass.c +++ b/src/genpass.c @@ -13,7 +13,7 @@ void genpass(int count, bool issecure) { FILE *fp = fopen("/dev/random", "rb"); if (fp == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Could not opening /dev/random"); + perror("Could not open /dev/random"); else perror("/dev/randomを開けられませんでした"); exit(EXIT_FAILURE); } diff --git a/src/initpass.c b/src/initpass.c index 615d99b..2b4e71b 100644 --- a/src/initpass.c +++ b/src/initpass.c @@ -7,7 +7,7 @@ void initpass(char *gpgid) { char *homedir = getenv("HOME"); if (homedir == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to getting home directory."); + perror("Failed to get home directory."); else perror("ホームディレクトリを受取に失敗。"); return; } @@ -18,7 +18,7 @@ void initpass(char *gpgid) { if (mkdir_r(dirpath, 0755) != 0 && errno != EEXIST) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to creating directory."); + perror("Failed to create directory."); else perror("ディレクトリを作成に失敗。"); return; } @@ -29,7 +29,7 @@ void initpass(char *gpgid) { struct stat statbuf; if (stat(gpgidpath, &statbuf) == 0) { if (strncmp(lang, "en", 2) == 0) - perror(".gpg-id file is already exist."); + perror(".gpg-id file already exists."); else perror(".gpg-idファイルは既に存在します。"); return; } @@ -37,7 +37,7 @@ void initpass(char *gpgid) { FILE *gpgidfile = fopen(gpgidpath, "w"); if (gpgidfile == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to writing .gpg-id file."); + perror("Failed to write .gpg-id file."); else perror(".gpg-idファイルを書き込めません。"); fclose(gpgidfile); return; @@ -45,7 +45,7 @@ void initpass(char *gpgid) { if (fputs(gpgid, gpgidfile) == EOF) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to writing .gpg-id file."); + perror("Failed to write .gpg-id file."); else perror(".gpg-idファイルへの書き込みに失敗しました。"); fclose(gpgidfile); return; @@ -53,6 +53,6 @@ void initpass(char *gpgid) { fclose(gpgidfile); if (strncmp(lang, "en", 2) == 0) - puts("First time setup was complete."); + puts("Initialization completed."); else puts("初期設定に完了しました。"); } diff --git a/src/listpass.c b/src/listpass.c index 3308c24..cc2e08f 100644 --- a/src/listpass.c +++ b/src/listpass.c @@ -10,7 +10,7 @@ void listpass(char *basePath, int level) { DIR* dir = opendir(basePath); if (!dir) { if (strncmp(lang, "en", 2) == 0) - perror("Could not opening directory"); + perror("Could not open directory"); else perror("ディレクトリを開けられません"); return; } @@ -24,7 +24,7 @@ void listpass(char *basePath, int level) { int needed = snprintf(path, sizeof(path), "%s/%s", basePath, entry->d_name); if (needed >= (int)sizeof(path) || needed < 0) { if (strncmp(lang, "en", 2) == 0) - perror("Error: Path is too long, or failed to getting lenth"); + perror("Error: Path is too long, or failed to get lenth"); else perror("エラー:パスが長すぎる、又は長さを受取に失敗"); continue; } @@ -32,7 +32,7 @@ void listpass(char *basePath, int level) { struct stat statbuf; if (stat(path, &statbuf) == -1) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to reading file status"); + perror("Failed to read file status"); else perror("ファイル状況を読込に失敗"); continue; } diff --git a/src/otppass.c b/src/otppass.c index 4df0d73..c74f130 100644 --- a/src/otppass.c +++ b/src/otppass.c @@ -11,7 +11,7 @@ unsigned char *extract_secret(const char *otpauth_url, size_t *decoded_len) { const char *secret_start = strstr(otpauth_url, "secret="); if (!secret_start) { if (strncmp(lang, "en", 2) == 0) - perror("In the middle of the OTPAuth URL, could not found secret"); + perror("Failed to find secret in the OTPAuth URL"); else perror("OTPAuth URLの中に、シークレットを見つけられませんでした"); return NULL; } @@ -28,7 +28,7 @@ unsigned char *extract_secret(const char *otpauth_url, size_t *decoded_len) { if (secret_end < secret_start) { if (strncmp(lang, "en", 2) == 0) - perror("Illegal secret range"); + perror("Incorrect secret range"); else perror("不正なシークレットの距離"); return NULL; } @@ -38,7 +38,7 @@ unsigned char *extract_secret(const char *otpauth_url, size_t *decoded_len) { if (secret_encoded == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to allocating memory"); + perror("Failed to allocate memory"); else perror("メモリの役割に失敗"); return NULL; } @@ -51,7 +51,7 @@ unsigned char *extract_secret(const char *otpauth_url, size_t *decoded_len) { if (!secret_decoded) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to decrypting of the BASE32"); + perror("Failed to decrypt BASE32"); else perror("BASE32の復号化に失敗"); return NULL; } @@ -95,15 +95,15 @@ void otppass(char *file) { err = gpgme_new(&ctx); if (err) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to generating the GPG"); - else perror("GPGMEを創作に失敗"); + perror("Failed to generate the GPG"); + else perror("GPGを創作に失敗"); exit(1); } err = gpgme_data_new_from_file(&in, file, 1); if (err) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to reading the GPG file"); + perror("Failed to read the GPG file"); else perror("GPGファイルを読込に失敗"); exit(1); } @@ -111,7 +111,7 @@ void otppass(char *file) { err = gpgme_data_new(&out); if (err) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to reading the GPG data"); + perror("Failed to read the GPG data"); else perror("GPGデータを読込に失敗"); exit(1); } @@ -119,7 +119,7 @@ void otppass(char *file) { err = gpgme_op_decrypt(ctx, in, out); if (err) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to decrypting the GPG"); + perror("Failed to decrypt the GPG"); else perror("GPGを復号化に失敗"); exit(1); } @@ -127,7 +127,7 @@ void otppass(char *file) { char *secret = gpgme_data_release_and_get_mem(out, &secret_len); if (!secret) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to getting the GPG"); + perror("Failed to get the GPG"); else perror("GPGを受取に失敗"); exit(1); } @@ -138,7 +138,7 @@ void otppass(char *file) { unsigned char *secret_decoded = extract_secret(secret, &decoded_len); if (!secret_decoded) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to decoding or exporting secret"); + perror("Failed to decode or export secret"); else perror("シークレットの抽出又はデコードに失敗しました"); free(secret); exit(1); diff --git a/src/showpass.c b/src/showpass.c index 3347004..826974b 100644 --- a/src/showpass.c +++ b/src/showpass.c @@ -34,7 +34,7 @@ const char *showpass(char *file) { err = gpgme_new(&ctx); if (err) { if (strncmp(lang, "en", 2) == 0) - fprintf(stderr, "Failed to generating GPGME: %s\n", gpgme_strerror(err)); + fprintf(stderr, "Failed to generate GPGME: %s\n", gpgme_strerror(err)); else fprintf(stderr, "GPGMEを創作に失敗:%s\n", gpgme_strerror(err)); return NULL; } @@ -46,7 +46,7 @@ const char *showpass(char *file) { char *homedir = getenv("HOME"); if (homedir == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to getting home directory"); + perror("Failed to get home directory"); else perror("ホームディレクトリを受取に失敗"); return NULL; } @@ -57,7 +57,7 @@ const char *showpass(char *file) { char *gpgpath = malloc(alllen); if (gpgpath == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to allocating memeory"); + perror("Failed to allocate memeory"); else perror("メモリを割当に失敗"); return NULL; } @@ -67,7 +67,7 @@ const char *showpass(char *file) { gpgfile = fopen(gpgpath, "rb"); if (gpgfile == NULL) { if (strncmp(lang, "en", 2) == 0) { - perror("Failed to opening file"); + perror("Failed to open file"); } else { perror("ファイルを開くに失敗"); } @@ -78,7 +78,7 @@ const char *showpass(char *file) { // ファイルからinデータオブジェクトを創作 if (gpgme_data_new_from_stream(&in, gpgfile) != GPG_ERR_NO_ERROR) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to generating the GPGME data object"); + perror("Failed to generate the GPGME data object"); else perror("GPGMEデータオブジェクトを創作に失敗"); clean_up(ctx, in, out, gpgfile, gpgpath); return NULL; @@ -87,7 +87,7 @@ const char *showpass(char *file) { // outデータオブジェクトを創作 if (gpgme_data_new(&out) != GPG_ERR_NO_ERROR) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to generating the GPGME data object"); + perror("Failed to generate the GPGME data object"); else perror("GPGMEデータオブジェクトを創作に失敗"); clean_up(ctx, in, out, gpgfile, gpgpath); return NULL; @@ -100,7 +100,7 @@ const char *showpass(char *file) { err = gpgme_op_decrypt(ctx, in, out); if (err) { if (strncmp(lang, "en", 2) == 0) - fprintf(stderr, "Failed to decrypting: %s\n", gpgme_strerror(err)); + fprintf(stderr, "Failed to decrypt: %s\n", gpgme_strerror(err)); else fprintf(stderr, "復号化に失敗: %s\n", gpgme_strerror(err)); // 掃除 @@ -114,7 +114,7 @@ const char *showpass(char *file) { char *res = malloc(512 * sizeof(char)); if (res == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to allocating memory"); + perror("Failed to allocate memory"); else perror("メモリを役割に失敗"); clean_up(ctx, in, out, gpgfile, gpgpath); return NULL; diff --git a/src/yankpass.c b/src/yankpass.c index de583f5..ac5a814 100644 --- a/src/yankpass.c +++ b/src/yankpass.c @@ -11,7 +11,7 @@ void yankpass(char *file) { // Xセッションではない場合(例えば、SSH、TTY、Gayland等)、showpass()を実行して if (getenv("DISPLAY") == NULL) { if (strncmp(lang, "en", 2) == 0) - puts("There is no X session, so executing 'sp -s'."); + puts("There is no X session, so running 'sp -s'."); else puts("Xセッションではありませんので、「sp -s」を実行します。"); showpass(file); return; @@ -31,7 +31,7 @@ void yankpass(char *file) { err = gpgme_new(&ctx); if (err) { if (strncmp(lang, "en", 2) == 0) - fprintf(stderr, "Failed to generating GPGME: %s\n", gpgme_strerror(err)); + fprintf(stderr, "Failed to generate GPGME: %s\n", gpgme_strerror(err)); else fprintf(stderr, "GPGMEを創作に失敗:%s\n", gpgme_strerror(err)); return; } @@ -43,7 +43,7 @@ void yankpass(char *file) { char* homedir = getenv("HOME"); if (homedir == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to getting home directory"); + perror("Failed to get home directory"); else perror("ホームディレクトリを受取に失敗"); return; } @@ -54,7 +54,7 @@ void yankpass(char *file) { char* gpgpath = malloc(alllen); if (gpgpath == NULL) { if (strncmp(lang, "en", 2) == 0) - perror("Failed to allocating memory"); + perror("Failed to allocate memory"); else perror("メモリを割当に失敗"); return; } @@ -63,7 +63,7 @@ void yankpass(char *file) { gpgfile = fopen(gpgpath, "rb"); if (gpgfile == NULL) { if (strncmp(lang, "en", 2) == 0) { - perror("Failed to opening the file"); + perror("Failed to open the file"); fprintf(stderr, "Failed path: %s\n", gpgpath); } else { perror("ファイルを開くに失敗"); @@ -81,7 +81,7 @@ void yankpass(char *file) { err = gpgme_op_decrypt(ctx, in, out); if (err) { if (strncmp(lang, "en", 2) == 0) - fprintf(stderr, "Failed to decryption: %s\n", gpgme_strerror(err)); + fprintf(stderr, "Failed to decrypt: %s\n", gpgme_strerror(err)); else fprintf(stderr, "復号化に失敗: %s\n", gpgme_strerror(err)); // 掃除 @@ -104,7 +104,7 @@ void yankpass(char *file) { gpgme_data_release(out); gpgme_release(ctx); if (strncmp(lang, "en", 2) == 0) - perror("Could not found a clipboard"); + perror("Could not find a clipboard"); else perror("クリップボードを見つけられませんでした"); return; } @@ -129,7 +129,7 @@ void yankpass(char *file) { printf( "%s\n%s\n", "Added password to the clipboard.", - "I will take it away from the clipboard after 45 second." + "After 45 seconds it'll be deleted from the clipboard." ); else printf(