Changes between Version 1 and Version 2 of TracWikiNegotiatorPlugin


Ignore:
Timestamp:
Mar 28, 2007 3:21:28 PM (7 years ago)
Author:
gotoh
Comment:

Describe how to install / setup / use.

Legend:

Unmodified
Added
Removed
Modified
  • TracWikiNegotiatorPlugin

    v1 v2  
    2424You can check out TracWikiNegotiatorPlugin from [http://trac-hacks.org/svn/tracwikinegotiatorplugin here] using Subversion, or [source:tracwikinegotiatorplugin browse the source] with Trac. 
    2525 
    26 == Example == 
     26== How to Install == 
     27Build egg file and place it appropriate place 
     28 
     29If you want to install as system wide plugin: 
     30{{{ 
     31$ python setup.py install 
     32}}} 
     33 
     34If you want to build plugin egg file and use it in some projects, 
     35build egg file and copy it into `plugins` directory under the trac 
     36environment directory: 
     37{{{ 
     38$ python setup.py bdist_egg 
     39... 
     40$ cp dist/*.egg /your/trac/project/plugins 
     41}}} 
     42 
     43== How to Setup == 
     44 
     45On using this plugin, do not forget enabling plugin  
     46`WikiNegotiator` in `trac.ini` or via `WebAdmin` page. 
    2747 
    2848{{{ 
    2949[components] 
    30 tracnegotiator.* = enabled 
     50wikinegotiator.* = enabled 
    3151 
    3252[wiki] 
    33 default_language = en 
     53default_lang = en 
    3454 
    3555}}} 
     56 
     57 
     58== How to Use == 
     59 
     60Using the negotiation feature is simply providing suffixed page like 
     61'Foo.ja' for Japanese, 'Foo.fr' for French, so on.  When Japanese user 
     62(with Japanese setting in browser) access to the page 'Foo', he will 
     63see the content of `Foo.ja` instead of `Foo`. Likewise, French use 
     64will see the content of `Foo.fr`. So what you should to do is creating 
     65localized page content as usual way. Note that suffix like '.ja' and 
     66'.fr' is to be a standard language code. 
     67 
     68Non-suffixed page `Foo` is also usable for default content 
     69when no suffixed page is matched to user's request. 
     70 
     71To see the page for your language, nothing to do to view localized page. 
     72To see the page for other language, specify the appropreate suffix for 
     73wiki page name in url explicitly, or add query parameter like "?lang=xx". 
     74 
     75To edit the page, you can edit the page now you are seeing by simply 
     76press "Edit" button. 
     77To edit the page for other language, first, visit the desired page 
     78with a way described above, then press "Edit" button. 
     79 
     80 
     81==  Bonus Macro == 
     82 
     83For bonus, this plugin contains one new macro: `MultiLangTitleIndex`. 
     84This is alternative macro of `TitleIndex`.  
     85 
     86The difference of two are: 
     87 * Display in one line for variants like: "`* WikiStart (ja, en, other)`". 
     88 * List pages in two columns: one is for user's pages, one is for 
     89   system provided pages. System pages are the pages made by trac. 
     90   `WikiStart` and `SandBox` are exception by default because it is 
     91   a page to be edited by user. 
     92 
     93It is useful for the site having many localized pages. 
     94You can use it by editing `TitleIndex` page. 
    3695 
    3796