You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An environment variable LANG needs to contain a GNU posix locale
for it to pick up the right language file.
- Added a functional test for it too.
- Now we look into other platforms also and show the page
along with a warning message that this page is from
a different platform.
This follows the spec more closely.
Copy file name to clipboardExpand all lines: README.md
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ To see tldr pages:
41
41
-`tldr <command> --os=<platform>` show command page for the given platform (`linux`, `osx`, `sunos`)
42
42
-`tldr --search "<query>"` search all pages for the query
43
43
-`tldr --linux <command>` show command page for Linux
44
-
-`tldr --osx <command>` show command page for OSX
44
+
-`tldr --osx <command>` show command page for OSX
45
45
-`tldr --sunos <command>` show command page for SunOS
46
46
-`tldr --list` show all pages for current platform
47
47
-`tldr --list-all` show all available pages
@@ -59,6 +59,14 @@ As a contributor, you might also need the following commands:
59
59
60
60
-`tldr --render <path>` render a local page for testing purposes
61
61
62
+
Tldr pages defaults to showing pages in the current language of the operating system, or English if that's not available. To view tldr pages for a different language, set an environment variable `LANG` containing a valid [POSIX locale](https://www.gnu.org/software/gettext/manual/html_node/Locale-Names.html#Locale-Names) (such as `zh`, `pt_BR`, or `fr`) and then run the above commands as usual. In most `*nix` systems, this variable will already be set.
63
+
64
+
It is suggested that the `LANG` environment variable be set system-wide if this isn't already the case. Users without `sudo` access can set it locally in their `~/.profile`.
65
+
66
+
-`LANG=zh tldr <command>`
67
+
68
+
For the list of available translations, please refer to the main [tldr](https://github.com/tldr-pages/tldr) repo.
69
+
62
70
## Configuration
63
71
64
72
You can configure the `tldr` client by adding a `.tldrrc` file in your HOME directory. You can copy the contents of the `config.json` file from the repo to get the basic structure to start with, and modify it to suit your needs.
Then most probably your npm's default installation directory has improper permissions. You can resolve it by clicking [here](https://docs.npmjs.com/getting-started/fixing-npm-permissions)
157
-
158
-
- If you are trying to install as a root user (`sudo npm install -g tldr`) and get something like -
165
+
166
+
- If you are trying to install as a root user (`sudo npm install -g tldr`) and get something like:
159
167
160
168
```
161
-
as root ->
169
+
as root ->
162
170
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/tldr/node_modules/webworker-threads/.node-gyp"
163
171
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/tldr/node_modules/webworker-threads/.node-gyp/8.9.1"
164
172
```
165
173
166
174
You need to add the option `--unsafe-perm` to your command. This is because when npm goes to the postinstall step, it downgrades the permission levels to "nobody". Probably you should fix your installation directory permissions and install as a non-root user in the first place.
167
175
168
-
- If you see an error related to `webworker-threads` like -
176
+
- If you see an error related to `webworker-threads` like:
0 commit comments