Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

mkmsgs(1)

名前

mkmsgs - gettxt でアクセスできるメッセージファイルの作成

形式

mkmsgs [-o] [-i locale] inputstrings msgfile

説明

The mkmsgs utility is used to create a file of text strings that can be accessed using the text retrieval tools gettxt(1), exstr(1), and gettxt(3C).入力の対象は、特定のロケール (setlocale(3C) を参照) 用のテキスト文字列のファイルです。出力先は、gettxt(1)gettxt(3C) の両方で検索できる形式のテキスト文字列のファイルです。By using the –i option, you can install the created file under the /usr/lib/locale/locale/LC_MESSAGES directory, where locale corresponds to the language in which the text strings are written.

inputstrings 引数には、もとになるテキスト文字列を 含んだファイル名を指定します。msgfile は、mkmsgs が、gettxt(1)gettxt(3C) で読み取り可能な形式の文字列を書き込む出力ファイルの名前です。この msgfile 名は、長さが 14 文字以内であること、\0 (NULL) を含んでいないこと、スラッシュ (/) またはコロン (:) に該当する ASCII コードを含んでいないことが必要です。

入力ファイルの内容は、特定のロケールに対応したテキスト文字列がいくつか集まったものです。文字列と文字列とは復帰改行文字で区切られます。表示不可能な文字は、エスケープシーケンスとして アルファベットで表す必要があります。メッセージは inputstrings から順番に読み込まれ、変換され、msgfile に書き込まれます。空のメッセージを msgfile 中に生成する場合は、inputstrings 中の適切な位置に空の行を入れておいてください。

文字列の内容を変更する場合は、単に inputstrings ファイルを編集してください。新たな文字列は、ファイルの最後尾にだけ追加できます。追加を行なったら、新たに msgfile を作成して正しい場所に登録しておく必要があります。この手順を誤ると、検索機能使用時に誤った文字列が検索されて、ソフトウェアの互換性が損なわれます。

オプション

サポートしているオプションは、次のとおりです。

–o

msgfile がすでに存在していれば上書きします。

–i locale

Install msgfile in the /usr/lib/locale/locale/LC_MESSAGES directory.Only someone with appropriate privileges can create or overwrite files in this directory.Directories under /usr/lib/locale will be created if they do not exist.

使用例 1 mkmsgs コマンドの使用例

C.str という名の入力メッセージソースファイルの例です。


File %s:\t cannot be opened\n
%s: Bad directory\n
	.
	.
	.
write error\n
	.
	.
使用例 2 ファイルにテキスト文字列を作成するために C.str から入力文字列を使用する例

次のコマンドを実行すると、 C.str から文字列が読み取られ、適切な形式の文字列に変換され、現在のディレクトリ中の UX というファイルに書き込まれます。

example% mkmsgs C.str UX
使用例 3 ファイルにテキスト文字列を作成するために FR.str から入力文字列を使用する例

The following command uses the input strings from FR.str to create text strings in the appropriate format in the file UX in the directory /usr/lib/locale/fr/LC_MESSAGES:

example% mkmsgs -i fr FR.str UX

これらのテキスト文字列は、環境変数 LC_MESSAGES=fr が設定されていて、「機能説明」セクションの冒頭に一覧表示されているテキスト検索ツールのいずれかが呼び出された場合にアクセスされます。

ファイル

/usr/lib/locale/locale/LC_MESSAGES/*

message files created by mkmsgs for the locale locale

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
text/locale

関連項目

exstr(1), gettxt(1), setlocale(3C), gettxt(3C), attributes(7)