26 | | == Example == |
| 26 | == How to Install == |
| 27 | Build egg file and place it appropriate place |
| 28 | |
| 29 | If you want to install as system wide plugin: |
| 30 | {{{ |
| 31 | $ python setup.py install |
| 32 | }}} |
| 33 | |
| 34 | If you want to build plugin egg file and use it in some projects, |
| 35 | build egg file and copy it into `plugins` directory under the trac |
| 36 | environment directory: |
| 37 | {{{ |
| 38 | $ python setup.py bdist_egg |
| 39 | ... |
| 40 | $ cp dist/*.egg /your/trac/project/plugins |
| 41 | }}} |
| 42 | |
| 43 | == How to Setup == |
| 44 | |
| 45 | On using this plugin, do not forget enabling plugin |
| 46 | `WikiNegotiator` in `trac.ini` or via `WebAdmin` page. |
| 56 | |
| 57 | |
| 58 | == How to Use == |
| 59 | |
| 60 | Using 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 |
| 63 | see the content of `Foo.ja` instead of `Foo`. Likewise, French use |
| 64 | will see the content of `Foo.fr`. So what you should to do is creating |
| 65 | localized page content as usual way. Note that suffix like '.ja' and |
| 66 | '.fr' is to be a standard language code. |
| 67 | |
| 68 | Non-suffixed page `Foo` is also usable for default content |
| 69 | when no suffixed page is matched to user's request. |
| 70 | |
| 71 | To see the page for your language, nothing to do to view localized page. |
| 72 | To see the page for other language, specify the appropreate suffix for |
| 73 | wiki page name in url explicitly, or add query parameter like "?lang=xx". |
| 74 | |
| 75 | To edit the page, you can edit the page now you are seeing by simply |
| 76 | press "Edit" button. |
| 77 | To edit the page for other language, first, visit the desired page |
| 78 | with a way described above, then press "Edit" button. |
| 79 | |
| 80 | |
| 81 | == Bonus Macro == |
| 82 | |
| 83 | For bonus, this plugin contains one new macro: `MultiLangTitleIndex`. |
| 84 | This is alternative macro of `TitleIndex`. |
| 85 | |
| 86 | The 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 | |
| 93 | It is useful for the site having many localized pages. |
| 94 | You can use it by editing `TitleIndex` page. |