Browse Source

developing: Mention how translated strings are marked in source

tags/v1.1.0-rc1
Daniel Oaks 5 years ago
parent
commit
a8f04ecc4d
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      DEVELOPING.md

+ 9
- 0
DEVELOPING.md View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 This is just a bunch of tips and tricks we keep in mind while developing Oragono. If you wanna help develop as well, they might also be worth keeping in mind!
4 4
 
5
+
5 6
 ## Golang issues
6 7
 
7 8
 You should use the [latest distribution of the Go language for your OS and architecture](https://golang.org/dl/). (If `uname -m` on your Raspberry Pi reports `armv7l`, use the `armv6l` distribution of Go; if it reports v8, you may be able to use the `arm64` distribution.)
@@ -10,6 +11,7 @@ Oragono vendors all its dependencies. The vendored code is tracked via a git sub
10 11
 
11 12
 Because of this, Oragono is self-contained and you should not need to fetch any dependencies with `go get`. Doing so is not recommended, since it may fetch incompatible versions of the dependencies. If you're having trouble building the code, it's very likely because your clone of the repository is in the wrong place: Go is very opinionated about where you should keep your code. Take a look at the [go workspaces documentation](https://golang.org/doc/code.html) if you're having trouble.
12 13
 
14
+
13 15
 ## Branches
14 16
 
15 17
 The `master` branch should be kept relatively runnable. It might be a bit broken or contain some bad commits now and then, but the pre-release checks should weed those out before users see them.
@@ -146,6 +148,13 @@ In order to allow this, in command handlers we don't send responses directly bac
146 148
 Basically, if you're in a command handler and you're sending a response back to the requesting client, use `rb.Add*` instead of `client.Send*`. Doing this makes sure the labeled responses feature above works as expected. The handling around `PRIVMSG`/`NOTICE`/`TAGMSG` is strange, so simply defer to [irctest](https://github.com/DanielOaks/irctest)'s judgement about whether that's correct for the most part.
147 149
 
148 150
 
151
+## Translated strings
152
+
153
+The function `client.t()` is used fairly widely throughout the codebase. This function translates the given string using the client's negotiated language. If the parameter of the function is a string, the translation update script below will grab that string and mark it for translation.
154
+
155
+In addition, throughout most of the codebase, if a string is created using the backtick characters ``(`)``, that string will also be marked for translation. This is really useful in the cases of general errors and other strings that are created far away from the final `client.t` function they are sent through.
156
+
157
+
149 158
 ## Updating Translations
150 159
 
151 160
 We support translating server strings using [CrowdIn](https://crowdin.com/project/oragono)! To send updated source strings to CrowdIn, you should:

Loading…
Cancel
Save