Skip to content

Commit 5e57f0a

Browse files
Added goi18n2 binaries
1 parent 2aa0619 commit 5e57f0a

7 files changed

Lines changed: 4 additions & 13 deletions

File tree

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -337,20 +337,9 @@ cobraCmd.AddCommand(NewActionNameCommand(sl).Command)
337337

338338
## i18n stuff
339339

340-
anything with `T("some string here")` uses the internationalization system. Definitions are located in `plugin\i18n\en_US.all.json` for english.
341-
The string passed into the `T()` function serves as the ID when looking these up. So the ID Will need to be present in all i18n files, it will also need a translation string.
340+
anything with `T("some string here")` uses the internationalization system. Specifically we use the [goi18n/v2](https://github.com/nicksnyder/go-i18n) library for most work here.
342341

343-
[i18n4go](https://github.com/maximilien/i18n4go) is used to make sure all strings being transalted have translations. To test run this command.
344-
345-
For i18n4go, we specifically use v0.2.4 for now, so we have a prebuilt binary in `./bin/i18n4go`. If that binary needs to be rebuilt, use the SoftLayer fork at https://github.com/softlayer/i18n4go (which is set to the version we need, along with some updates since that version had a bug with --help).
346-
347-
This command will build the Mac (arm64) version. Replace GOOS and GOARCH with the OS/Architecture you need to build for.
348-
```
349-
~/go/src/github.ibm.com/softlayer/softlayer-cli/i18n4go (master)
350-
$> GOOS=darwin GOARCH=arm64 go build -o i18n4go_mac -ldflags "-s -w" i18n4go/i18n4go.go
351-
$> GOOS=linux GOARCH=amd64 go build -o out/i18n4go ./i18n4go/i18n4go.go
352-
```
353-
[go-bindata](https://github.com/jteeuwen/go-bindata) takes the json files, and turns them into a go binary.
342+
Currently we use a custom version of [goi18n](https://github.com/allmightyspiff/go-i18n/tree/Tfunctions) which can parse `T()` functions like we use (an artiface of migrating from v1 to v2).
354343

355344

356345
### Basic Patterns and Tips
@@ -369,6 +358,8 @@ subs := map[string]interface{}{"CMDTYPE": "block"}
369358
T("This is some output for a {{.CMDTYPE}} command", subs)
370359
```
371360

361+
*NOTICE* goi18n/v2 has some newer features that can make this a bit easier to deal with, but I'm not sure they are currently supported, so procede with caution in you make use of them.
362+
372363
### Useful Scripts
373364

374365
#### `./bin/buildAndDeploy.py i18n`

bin/goi18n2

4.42 MB
Binary file not shown.

bin/goi18n2.exe

4.56 MB
Binary file not shown.

bin/goi18n2_mac

4.33 MB
Binary file not shown.

bin/i18n4go

-8.46 MB
Binary file not shown.

bin/i18n4go.exe

-8.58 MB
Binary file not shown.

bin/i18n4go_mac

-6.06 MB
Binary file not shown.

0 commit comments

Comments
 (0)