Changes between Version 10 and Version 11 of TracWikiNegotiatorPlugin


Ignore:
Timestamp:
Jul 27, 2015, 12:11:38 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, tagged with license

Legend:

Unmodified
Added
Removed
Modified
  • TracWikiNegotiatorPlugin

    v10 v11  
    11[[PageOutline(2-5,Contents,pullout)]]
    2 = Content negotiation plugin for Trac wiki =
    32
    4 == Description ==
     3= Content negotiation plugin for Trac wiki
    54
    6 This plugin provides content negotiation mechanism for Trac wiki
    7 pages.  With this plugin, your Trac site can provides localized pages
    8 for users.
     5== Description
    96
    10 == Bugs/Feature Requests ==
     7This plugin provides content negotiation mechanism for Trac wiki pages. With this plugin, your Trac site can provide localized pages for users.
     8
     9== Bugs/Feature Requests
    1110
    1211Existing bugs and feature requests for TracWikiNegotiatorPlugin are
     
    1413
    1514If you have any issues, create a
    16 [http://trac-hacks.org/newticket?component=TracWikiNegotiatorPlugin&owner=gotoh new ticket].
     15[/newticket?component=TracWikiNegotiatorPlugin new ticket].
    1716
    18 == Download ==
     17[[TicketQuery(component=TracWikiNegotiatorPlugin&group=type,format=progress)]]
     18
     19== Download
    1920
    2021Download the zipped source from [download:tracwikinegotiatorplugin here].
    2122
    22 == Source ==
     23== Source
    2324
    2425You can check out TracWikiNegotiatorPlugin from [http://trac-hacks.org/svn/tracwikinegotiatorplugin here] using Subversion, or [source:tracwikinegotiatorplugin browse the source] with Trac.
    2526
    26 == Install ==
     27== Installation
    2728
    28 Build egg file and place it appropriate place
     29Build the egg file and place it in the plugins directory of your Trac environment.
    2930
    30 If you want to install as system wide plugin:
    31 {{{
     31If you want to install as a system wide plugin:
     32{{{#!sh
    3233$ python setup.py install
    3334}}}
    3435
    35 If you want to build plugin egg file and use it in some projects,
    36 build egg file and copy it into `plugins` directory under the trac
    37 environment directory:
    38 {{{
     36If you want to build the plugin's egg file and use it in your projects, build the egg file and copy it into the `plugins` directory under the Trac environment directory:
     37{{{#!sh
    3938$ python setup.py bdist_egg
    4039...
     
    4241}}}
    4342
    44 == How to Setup ==
     43== Configuration
    4544
    46 On using this plugin, do not forget enabling plugin
    47 `WikiNegotiator` in `trac.ini` or via `WebAdmin` page.
    48 
    49 {{{
     45On using this plugin, do not forget the enable the plugin `WikiNegotiator` in `trac.ini` or via `WebAdmin` page:
     46{{{#!ini
    5047[components]
    5148wikinegotiator.* = enabled
    52 
     49...
    5350[wiki]
    5451default_lang = en
    55 
    5652}}}
    5753
    58 Note that `TitleIndex` macro and `TOC` macro (by tractoc plugin) is
    59 overridden by enabling this plugin. To use original macro, you should
    60 disable new macro explicitly. See [#BonusMacro Bonus Macro] for
    61 more detail.
     54Note that `TitleIndex` macro and `TOC` macro (by tractoc plugin) is overridden by enabling this plugin. To use original macro, you should
     55disable the new macro explicitly, see [#BonusMacro Bonus Macro] for more detail.
    6256
     57== Usage
    6358
    64 == How to Use ==
     59Using the negotiation feature is simply providing suffixed page like 'Foo.ja' for Japanese, 'Foo.fr' for French, so on. When Japanese user
     60(with Japanese setting in browser) access to the page 'Foo', he will see the content of `Foo.ja` instead of `Foo`. Likewise, French user will see the content of `Foo.fr`. So what you should do is creating localized page content in the usual way. Note that suffix like '.ja' and '.fr' is to be a standard language code.
    6561
    66 Using the negotiation feature is simply providing suffixed page like
    67 'Foo.ja' for Japanese, 'Foo.fr' for French, so on.  When Japanese user
    68 (with Japanese setting in browser) access to the page 'Foo', he will
    69 see the content of `Foo.ja` instead of `Foo`. Likewise, French use
    70 will see the content of `Foo.fr`. So what you should to do is creating
    71 localized page content as usual way. Note that suffix like '.ja' and
    72 '.fr' is to be a standard language code.
     62Non-suffixed page `Foo` is also usable for default content when no suffixed page is matched to user's request.
    7363
    74 Non-suffixed page `Foo` is also usable for default content
    75 when no suffixed page is matched to user's request.
     64To see the page for your language, nothing to do to view localized page. To see the page for other language, specify the appropriate suffix for
     65wiki page name in the url explicitly, or add query parameter like "?lang=xx".
    7666
    77 To see the page for your language, nothing to do to view localized page.
    78 To see the page for other language, specify the appropreate suffix for
    79 wiki page name in url explicitly, or add query parameter like "?lang=xx".
     67To edit the page, you can edit the page now you are seeing by simply press "Edit" button.
     68To edit the page for another language, first visit the desired page with a way described above, then press "Edit" button.
    8069
    81 To edit the page, you can edit the page now you are seeing by simply
    82 press "Edit" button.
    83 To edit the page for other language, first, visit the desired page
    84 with a way described above, then press "Edit" button.
     70== Language Menu
    8571
     72By using this plugin, you can see new language menu bar above the wiki context navigation menu. It displays available languages on this site automatically by finding language suffixes of wiki pages.
    8673
    87 == Language Menu ==
     74'''Note:''' Users who installed earlier version (before r4974) on Trac 0.11 may need enabling `WikiNegotiatorMenuBar` component to display language menu.
    8875
    89 By using this plugin, you can see new language menu bar above the
    90 wiki context navigation menu. It displays available languages
    91 on this site automatically by finding language suffixes of wiki pages.
    92  
    93   '''Notice:''' Users who installed earlier version (before r4974) on trac 0.11
    94   may need enabling `WikiNegotiatorMenuBar` component to display language menu.
     76You can select language via this menu. Because it is held in the session information, you can run with the language without re-selection.
    9577
    96 You can select language via this menu. Because it is holded in the session
    97 information, you can walk with the language without re-selection.
    98 
    99 The selected language are displayed underlined and bolded on the
    100 menu. If specific language content is not availabe, the language item
    101 in the menu is grayed.
     78The selected language are displayed underlined and bolded on the menu. If the specific language content is not availabe, the language item in the menu is greyed out.
    10279
    10380There are 5 kind of display styles:
     
    11794
    11895The style of language menu can be changed by `menu_style` option:
    119 {{{
     96{{{#!ini
    12097[wiki-negotiator]
    121 menu_style=ctxnav
     98menu_style = ctxnav
    12299}}}
    123100
     101==  Bonus Macro
    124102
    125 ==  Bonus Macro ==
     103For bonus, this plugin contains two new macro: `MultiLangTitleIndex` and `NTOC`.
     104The former is an alternative macro of `TitleIndex`.
     105The later is an alternative of `TOC` macro, see [th:wiki:tocmacro tocmacro] in Trac-Hacs for more detail.
    126106
    127 For bonus, this plugin contains two new macro: `MultiLangTitleIndex`
    128 and `NTOC`.
    129 The former is an alternative macro of `TitleIndex`.
    130 The later is an alternative of `TOC` macro.
    131 (see [th:wiki:tocmacro tocmacro] in Trac-Hacs for more detail)
     107And this plugin has the definitions to override original `TitleIndexMacro` and `TOCMacro` automatically.
     108'''So you do not need to edit wiki pages to use both two new macros'''.
    132109
    133 And this plugin has the definitions to override original
    134 `TitleIndexMacro` and `TOCMacro` automatically.
    135 '''So you do not need to edit wiki pages to use both two new macros'''.
    136 If you want to disable new feature and use original,
    137 disable new macros explicitly in `trac.ini` like this:
    138 {{{
     110If you want to disable new feature and use original, disable new macros explicitly in `trac.ini` like this:
     111{{{#!ini
    139112[components]
    140113wikinegotiator.macros.titleindexmacro = disabled
     
    142115}}}
    143116
    144 === `MultiLangTitleIndex` ===
     117=== `MultiLangTitleIndex`
     118
    145119The differences against `TitleIndex` are:
    146120 * Display in one line for variants like: "* !WikiStart (ja, en, other)".
    147  * List pages in two columns: one is for user's pages, one is for
    148    system provided pages. System pages are the pages made by trac.
    149    `WikiStart` and `SandBox` are exception by default because it is
    150    a page to be edited by user.
     121 * List pages in two columns: one is for user's pages, one is for system provided pages. System pages are the pages made by Trac.
     122   `WikiStart` and `SandBox` are exception by default because it is a page to be edited by user.
    151123
    152124It is useful for the site having many localized pages.
    153125
    154 '''This feature is automatically enabled''' by overriding `TitleIndexMacro`
    155 when this plugin is enabled.
     126'''This feature is automatically enabled''' by overriding `TitleIndexMacro` when this plugin is enabled.
    156127
    157 === `NTOC` ===
    158 `NTOC` macro delives `TOC` macro, so all the features in `TOC` macro
    159 are available except handling lang suffixed pages.
    160 If you specify normal page name without explicit lang suffix
    161 (i.e. `WikiStart`), `NTOC` look up localized page for language same to
    162 parent page the macro is put on. If not exist, look up localized page
    163 for preferred langs. If not found, use specified name as is.
    164 So, it is easy to get localized TOC by simply specifyng base page names
    165 in argument.
     128=== `NTOC`
    166129
    167 `NTOC` also handles wildcard page argument by expanding and removing
    168 suffixed pages.
     130`NTOC` macro delives `TOC` macro, so all the features in `TOC` macro are available except handling lang suffixed pages.
     131If you specify normal page name without explicit lang suffix (i.e. `WikiStart`), `NTOC` look up localized page for language same to
     132parent page the macro is put on. If not exist, look up localized page for preferred langs. If not found, use specified name as is.
     133So, it is easy to get localized TOC by simply specifying base page names in argument.
    169134
    170 '''This feature is automatically enabled''' by overriding `TOCMacro`  if available
    171 when this plugin is enabled.
     135`NTOC` also handles wildcard page argument by expanding and removing suffixed pages.
    172136
     137'''This feature is automatically enabled''' by overriding `TOCMacro`  if available when this plugin is enabled.
    173138
    174 == Recent Changes ==
     139== Recent Changes
    175140
    176141[[ChangeLog(tracwikinegotiatorplugin, 3)]]
    177142
    178 == Author/Contributors ==
     143== Author/Contributors
    179144
    180145'''Author:''' [wiki:gotoh] [[BR]]
    181 '''Maintainer:''' [wiki:gotoh] [[BR]]
     146'''Maintainer:''' [[Maintainer]] [[BR]]
    182147'''Contributors:'''