Вход:  Пароль:  
FreeSource: PhpCoder/drafts?/DesktopEntrySpecification ...
Free Source | Каталог | Изменения | НовыеКомментарии | Пользователи | Регистрация |

Desktop Entry Specification

Спецификация для Desktop Entry


Авторы: Preston Brown <pbrown @ kde.org>, Jonathan Blandford <jrb @ redhat.com>, Owen Taylor <otaylor @ gtk.org>, Vincent Untz <vuntz@gnome.org>, Waldo Bastian <waldo.bastian@intel.com>
Переводчики: Slava Semushin <php-coder @ altlinux.ru>, Vitaly Lipatov <lav @ etersoft.ru>
Источник: http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html
Версия: 1.0
Статус: черновик (перевод только начат)
(не нуждается в перевода, как неактуальная)

Введение

Introduction

Обе рабочие среды, KDE и Gnome, приняли одинаковый формат для «описаний ресурсов (desktop entries)» или конфигурационных файлов, описывающих как каждая программа должна быть запущена, как должна выглядеть в меню и т.д. Это является большой пользой для сообщества, потому что унифицированный стандарт был согласован всеми сторонами и является примером взаимодействия между двумя окружениями и теперь создание любых дополнительных окружений, реализующих данную спецификацию, стали проще.
Both the KDE and GNOME desktop environments have adopted a similar format for «desktop entries», or configuration files describing how a particular program is to be launched, how it appears in menus, etc. It is to the larger community's benefit that a unified standard be agreed upon by all parties such that interoperation between the two environments, and indeed any additional environments that implement the specification, becomes simpler.

Базовый формат файла

Basic format of the file

Desktop-Файлы должны иметь расширение .desktop. Идентификация типа файла по его расширению делает определение типа файла очень простым и быстрым. Если у файла отсутствует расширение, то система будет вынуждена прибегнуть к опознанию через «магическое обнаружение». Desktop-файлы, которые описывают формат каталога и то, как он должен отображаться должны иметь расширение .directory.
These desktop entry files should have the extension .desktop. Determining file type on basis of extension makes determining the file type very easy and quick. When no file extension is present, the desktop system should fall back to recognition via “magic detection”. Desktop entries which describe how a directory is to be formatted/displayed should be simply called .directory.
Desktop-файлы содержат 8-битные символы, строки разделены символом LF. Регистр букв везде в файле имеет значение.
Desktop entry files are encoded as lines of 8-bit characters separated by LF characters. Case is significant everywhere in the file.
Вменяемые реализации не должны удалять никакие поля из файла, даже если они не поддерживают их. Такие поля должны содержаться в отдельном списке, и если файл будет перезаписан, то они должны быть включены в него снова. Это гарантирует, что любые специфичные для рабочей среды параметры будут сохранены, даже если другая система имеет доступ к файлу и изменяет его.
Compliant implementations MUST not remove any fields from the file, even if they don't support them. Such fields must be maintained in a list somewhere, and if the file is “rewritten”, they will be included. This ensures that any desktop-specific extensions will be preserved even if another system accesses and changes the file.

Замечания

Comments

Строки, начинающиеся с #, а также пустые строки, рассматриваются как комментарии и могут быть проигнорированы, тем не менее они должны быть сохранены при чтении и записи desktop-файла.
Lines beginning with a  and blank lines are considered comments and will be ignored, however they should be preserved across reads and writes of the desktop entry file.
Строки комментариев не обрабатываются и могут содержать любые символы (исключая LF). Впрочем, приветствуется использование использование кодировки UTF-8.
Comment lines are uninterpreted and may contain any character (except for LF). However, using UTF-8 for comment lines that contain characters not in ASCII is encouraged.

Заголовки групп

Group headers

Заголовок группы с именем groupname – это строка следующего вида:

A group header with name groupname is a line in the format:

Названия групп могут содержать любые символы из набора ASCII, за исключением [ и ], а также управляющих символов.
Group names may contain all ASCII characters except for [ and ] and control characters.
Различные группы не могут иметь одинаковые названия.
Multiple groups may not have the same name.
Все пары {ключ,значение}, следующие за заголовком группы, вплоть до нового заголовка группы, принадлежат к этой группе.
All {key,value} pairs following a group header until a new group header belong to the group.
Базовый формат для desktop-файла требует, чтобы в нём был заголовок группы с названием [Desktop Entry]. В файле могут быть указаны и другие группы, но Desktop Entry – наиболее важная группа, поддержка которой обязательна. Эта группа должна также использоваться как магический ключ для автоматического определения MIME-типа файла. Перед этой группой в файле не должно быть ничего, кроме одного или более комментариев.
The basic format of the desktop entry file requires that there be a group header named [Desktop Entry]. There may be other groups present in the file, but this is the most important group which explicitly needs to be supported. This group should also be used as the “magic key” for automatic MIME type detection. There should be nothing preceding this group in the desktop entry file but possibly one or more comments.

Поля

Entries

Записи в файле представляют собой пары {ключ, значение} следующего вида:
Entries in the file are {key,value} pairs in the format:

Пробелы до и после знака равенства должны игнорироваться; знак = является разделителем.
Space before and after the equals sign should be ignored; the = sign is the actual delimiter.
Название ключа должно содержать только символы A-Za-z0–9-.
Key names must contain only the characters A-Za-z0–9-.
Так как регистр букв имеет значение, ключи Name и NAME являются разными.
As the case is significant, the keys Name and NAME are not equivalent.
Различные ключи в одной группе не могут иметь одинаковые названия. Ключи в различных группах могут иметь одинаковое название.
Multiple keys in the same group may not have the same name. Keys in different groups may have the same name.

Возможные значения типов

Possible value types

Распознаются такие типы значений, как string, localestring, boolean и numeric.
The value types recognized are string, localestring, boolean, and numeric.
  • Значения типа string могут содержать все символы набора ASCII, за исключением управляющих символов.
  • Значения типа localestring показываются пользователю, и кодируются в UTF-8.
  • Значения типа boolean могут быть строкой true или false.
  • Значения типа numeric должны быть корректным числом с плавающей точкой, распознаваемым спецификатором %f функции scanf.
  • Values of type string may contain all ASCII characters except for control characters.
  • Values of type localestring are user displayable, and are encoded in UTF-8.
  • Values of type boolean must either be the string true or false.
  • Values of type numeric must be a valid floating point number as recognized by the %f specifier for scanf.
Для значений с типом string или localestring поддерживаются управляющие последовательности \s, \n, \t, \r и \\, означающие пробел, новую строку, символ табуляции, возврат каретки и обратный слэш, соответственно.
The escape sequences \s, \n, \t, \r, and \\ are supported for values of type string and localestring, meaning ASCII space, newline, tab, carriage return, and backslash, respectively.
Некоторые ключи могут иметь несколько значений. В таком случае, значение ключа указывается как множественное (например, string(s)). Значения должны быть разделены точкой с запятой. Такие ключи, имеющие несколько значений, должны иметь точку с запятой в качестве завершающего символа в строке. Точка с запятой в таких значениях должна быть экранирована с помощью \;.
Some keys can have multiple values. In such a case, the value of the key is specified as a plural: for example, string(s). The multiple values should be separated by a semicolon. Those keys which have several values should have a semicolon as the trailing character.
Semicolons in these values need to be escaped using \;.

Локализованные значения ключей

Localized values for keys

Ключи с типом localestring...
Keys with type localestring may be postfixed by [LOCALE], where LOCALE is the locale type of the entry. LOCALE must be of the form lang_COUNTRY.ENCODING@MODIFIER, where _COUNTRY,. ENCODING, and @MODIFIER may be omitted. If a postfixed key occurs, the same key must be also present without the postfix.

Распознаваемые ключи desktop-файлов

Recognized desktop entry keys

Ключ Exec

The Exec key

Регистрация MIME-типов

Registering MIME Types

Расширение формата

Extending the format

А. Пример desktop-файла

A. Example Desktop Entry File


Б. Зарезервированные для использования в KDE

B. Currently reserved for use within KDE

В. Устаревшие моменты

C. Deprecated Items

D. The Legacy-Mixed Encoding (Deprecated)


lav: обновил имеющуюся часть перевода до версии 1.0
продолжение следует...


Страницы, ссылающиеся на данную: PhpCoder
Standarts


Вы не владеете cтраницей PhpCoder/drafts/DesktopEntrySpecification и поэтому не можете получить список наблюдающих за ней


 
Файлов нет. [Показать файлы/форму]
Комментарии [Скрыть комментарии/форму]