Page History
All the text generated by CVSTrac is American English. But dates can be displayed in the local language and format. To show dates in the local language, do this:
- Create bash script to run CVSTrac in required locale. Example : uk-cvstrac
#!/bin/bash LANG=uk_UA.KOI8-U /usr/local/bin/cvstrac $*
- Replace "cvstrac" in your scripts by name of your new script (uk-cvstrac, in my case).
You can set LANG environment variable in xinet.d configuration (see "man xinetd.conf" for details):
env LANG=uk_UA.KOI8-U
or in .htaccess (in case of CGI script):
<IfModule mod_env.c> SetEnv LANG uk_UA.KOI8-U </IfModule>
If you want to run a localized CVSTrac in chroot environment (such as described in ChrootJailForCvstrac), use the following command to find all files required by the cvstrac binary.
strace -o logfile -e trace=file cvstrac ...
Then "logfile" will list file operations that cvstrac tried, whether they succeeded or not.
See also CvsTracLocalization
Localization of CVSTrac 2.0
SQLite3 officially supports only UTF-8 as text, but almost functions work fine even for other encodings.
So there is two way to localize cvstrac 2.0.
One is using UTF-8, the other is using local encoding.
- UTF-8
- Advantage
- Officially supported by SQLite3.
- Able to support multiple languages.
- Defect
- If sources are written in encodings which is not compatible to UTF-8, encoding conversions are required for each access to the repository.
- Can not use local encoding for filenames.
- Usage
- Convert encoding of the project database.
- Advantage
$ mv <project>.db <project>_old.db $ sqlite3 <project>_old.db .dump | iconv -f <oldencoding> -t UTF-8 | \ sqlite3 <project>.db
- Set the environment variable to UTF-8.
- If sources are written in encodings which is not compatible to UTF-8,
- Add a converting command to each commands at "Diff and Filter Programs"
of Setup.
For example,
- Add a converting command to each commands at "Diff and Filter Programs"
of Setup.
File Diff: rcsdiff -q -r'%V1' -r'%V2' -u '%F' | iconv -f <sourceencoding> -t UTF-8
File List: co -q -p'%V' '%F' | iconv -f <sourceencoding> -t UTF-8 | diff -c /dev/null -
File Filter: iconv -f <sourceencoding> -t UTF-8
- Apply the patch [808] and customize rlog command.
$ sqlite3 <project>.db sqlite> insert into config values('rlog', ...> 'rlog ''-d%TR'' ''%F'' 2>/dev/null | ' || ...> 'iconv -f <sourceencoding> -t UTF-8');
- Apply the patch [810] for the highlight() function.
(This patch doesn't support grapheme clusters.) - local encoding (equivalent to 1.2)
- Advantage
- No encoding conversion is required.
- Works with local encoding for filenames.
- Defect
- The search() function may match with not matching text.
(But "match with not matching" problem is not severe.) - The highlight() function may split in characters.
(But this problem is accepted by many users using multibyte encoding.) - In Big5 or ShiftJIS, '_', '[', '|' and '{...}' format may be broken.
(But the problems of '_' and '[' are very rare case.)
To avoid the problem of '|', apply the patch [813] and quote the broken character by {quote: }.
The problem of '{...}' is complicated. For example in ShiftJIS, the katakana-bo and katakana-ma character in the {link: url text} markup cause unexpected output. Using <html>...</html> is the only way to avoid this problem.
- The search() function may match with not matching text.
- Usage
- Set the environment variable to the local encoding.
- Apply the patch [811] for substr() and length() functions.
(This patch is not required if you don't use these functions in Reports.)
- Advantage
Attachments:
- cvstrac-customrlog.patch 816 bytes added by anonymous on 2006-Jun-02 08:40:42 UTC.
The patch for customizing rlog command.
- cvstrac-highlightutf8.patch 574 bytes added by anonymous on 2006-Jun-02 08:42:04 UTC.
The patch to support UTF-8 at highlight() function.
- cvstrac-stringfunc.patch 2819 bytes added by anonymous on 2006-Jun-02 08:42:53 UTC.
The patch to support local encodings at length() and substr() functions.