Граф коммитов

729 Коммитов

Автор SHA1 Сообщение Дата
Marcel van Lohuizen c48437bd2d language/internal: expose StringToBuf
Change-Id: I9c4f59999dcba5ba82839c3a4808d105dd1b88a2
Reviewed-on: https://go-review.googlesource.com/95825
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:24:30 +00:00
Marcel van Lohuizen 96ecc90db6 language: remove use of aliases
Change-Id: I44bda956eea7989eb1fccf90337361d6825567d4
Reviewed-on: https://go-review.googlesource.com/95824
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:23:11 +00:00
Marcel van Lohuizen 59a7c23b6f language: clean up gen
Mostly switch to use of CodeWriter.

Remove many old helper functions and move
main to top.

Change-Id: I957408391c26d49e1db13265dc8ebb7829e267eb
Reviewed-on: https://go-review.googlesource.com/95823
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:21:56 +00:00
Marcel van Lohuizen b85db4f711 language: use new internal language tag package
More cleanup to come in separate CL.

Compact index generation currently disabled.
Will need to be enabled again as part of the
new compact index implementation.

Change-Id: I571c34b700ca3f22959ab261525827c7edfab511
Reviewed-on: https://go-review.googlesource.com/95822
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:20:23 +00:00
Marcel van Lohuizen b83d5b81bf language/internal: expose alias data and ValueError
Change-Id: I5ff55e3d386fb516a09f886b34179c69ab7b87bc
Reviewed-on: https://go-review.googlesource.com/95821
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:05:39 +00:00
Marcel van Lohuizen 3c3e6a4440 language/internal: include body of old compose
This is like the old code but different. Prevents
some internals from having to be exposed.

Change-Id: Ibfd0c98e7ed276faab20789fd753f8ef5cf6bda5
Reviewed-on: https://go-review.googlesource.com/95820
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 18:00:35 +00:00
Marcel van Lohuizen 20787f6828 language/internal: more exposing of internals
Also simplify variants and extensions.

Change-Id: I3dfb347057302a7e5947ed35cbb29aa83d22ec0e
Reviewed-on: https://go-review.googlesource.com/95819
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 17:41:32 +00:00
Marcel van Lohuizen 42fe5789b3 language/internal: export tag types and rename fields
Change-Id: I5c8a590d2fdeeb5aa223c821751455c2f3eb9d9b
Reviewed-on: https://go-review.googlesource.com/95818
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 17:35:15 +00:00
Marcel van Lohuizen 7062ea6af1 language/internal: remove excess code
and make the minimal rewrite to make it build and pass tests

Removed higher-level functionality:
- canonicalization
- matching
- accept language
- coverage
- compact index
- compose
- higher level tag types

Added SuppressScript primitive to compensate for
Script removal.

Change-Id: I0e480ac6dcf78a2ab5d5a00aa0b480c8f1aed233
Reviewed-on: https://go-review.googlesource.com/95817
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 17:26:33 +00:00
Marcel van Lohuizen aee093ccdd language/internal: copy language for refactoring
Change-Id: I04dad1af3f709ecf2f92a7257717b195a832a641
Reviewed-on: https://go-review.googlesource.com/95816
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 17:23:49 +00:00
Marcel van Lohuizen ccf29a08cb language: change semantics of CompactIndex
This is the first CL in a sequence to enhance both the
performance and functionality of language Tags.

First step is to have CompactIndex implement the
semantics that it should have: rather than returning
Und when there is no match, it should return the closest
matching compact index. CompactIndex is often used
this way, and when it is not it was typcially a bug. This
fixes that.

Next steps are to have the fast-path internal encoding
of tag be a compact index.

The step after that is to keep two compact indexes,
allow representing both the language and locale part
of a tag like:
    en-US-va-posix
and
    en-GB-rg-gbsct

The result will allow for dual-mode tags resulting from
matching, simplifying the life of an API user.
(In Java the API users will get two tags from a match
and will have to decide on a case-by-case basis which
tag to use for which purpose.)
This design also allows for fast converstion to compact
indices, making it unnecessary for message.Printers to
extract this index.

Change-Id: I019ac6df4a3e3c7e6c758173fc942667df65ff36
Reviewed-on: https://go-review.googlesource.com/95815
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-23 17:23:06 +00:00
Marcel van Lohuizen 9e2b64d659 message: allow translated substitutions (%m)
Change-Id: I23fa5fe7ca43d993a8559fd6a35ecb36f082aaf2
Reviewed-on: https://go-review.googlesource.com/84715
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-02-21 12:18:26 +00:00
Nigel Tao 4e4a3210bb all: link to the "state of x/text" video
Change-Id: I1eedba96d30ee1587da6408b55b0a7f5b8c1463a
Reviewed-on: https://go-review.googlesource.com/91835
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-02-08 04:12:48 +00:00
Brad Fitzpatrick e19ae14969 currency: fix format in example
Fixes golang/go#23233

Change-Id: Ie89140502cc966acedea4abbaf66214b90ce570a
Reviewed-on: https://go-review.googlesource.com/85398
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-27 01:22:46 +00:00
Marcel van Lohuizen eb22672bea cmd/gotext: add update command
This is the recommended approach and will
likely replace export and generate.

Change-Id: Ie7dc0523c580715b8576de074f312b490a8727b6
Reviewed-on: https://go-review.googlesource.com/83776
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-18 11:36:26 +00:00
Marcel van Lohuizen 58f7a2daa8 message/pipeline: implement merge
- unique keys and identifiers
- detect collisions
- inject available translations in output files
- inject source language if applicable

Change-Id: I461a276c20b43161ee37499700e0feff82883e1b
Reviewed-on: https://go-review.googlesource.com/83819
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-18 11:35:59 +00:00
Marcel van Lohuizen 7418ca0c5b message/pipeline: hoist export code from cmd/text
Change-Id: I51ff721870bd91ade99d7afede56556535bc93bc
Reviewed-on: https://go-review.googlesource.com/83818
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-18 11:11:28 +00:00
Brad Fitzpatrick e1b31abf3e message/pipeline: fix build on Go 1.8
Fixes build failure on the dashboard for Go 1.8:
https://build.golang.org/log/ac5c9df1b367779239f82745c05ee5eb56b522f6

Change-Id: I37051590b50959a01db23bc6652469e1775fff05
Reviewed-on: https://go-review.googlesource.com/84515
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2017-12-18 07:30:39 +00:00
Marcel van Lohuizen d5a9226ed7 message/pipeline: set fallback language for tests
also add catalog comparison file.

Change-Id: I66c066fb52b8fb74d05a4be6d89a1f4ad3e701f8
Reviewed-on: https://go-review.googlesource.com/83817
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-15 20:38:59 +00:00
Marcel van Lohuizen a0f33c5bee message/pipeline: trim whitespace for messages
it is added back when rendering, but makes it hard
for the translator to forget about it.

Change-Id: Ic775e0707a9ec4fc0cdcf5351933ae9b05872d81
Reviewed-on: https://go-review.googlesource.com/83816
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-15 20:09:00 +00:00
Marcel van Lohuizen 5c426816db internal/catmsg: support Affix message type
Change-Id: Iabf2ef415f3610598607a44d8f2c35a70743da3e
Reviewed-on: https://go-review.googlesource.com/83815
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-15 20:07:45 +00:00
Marcel van Lohuizen b16005c867 message/pipeline: hoist importing from cmd/gotext
- cmd/gotext generate now extracts, so no need to
  create intermediate extraction file.
  (next step is to just have an update command)
- shared config creation code in cmd/text
- added tests in pipeline package

Change-Id: Ifdb69710554712a79bda79502e5e03a3f3a2c9d3
Reviewed-on: https://go-review.googlesource.com/83657
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-15 19:56:20 +00:00
Marcel van Lohuizen 73f72487b7 message/pipeline: fix extraction bug
NOTE: tests will be added soon, but in different CL

Change-Id: I4873c549938eaa2cd22ff2d725bb52bd26b26960
Reviewed-on: https://go-review.googlesource.com/83656
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-15 14:17:41 +00:00
Marcel van Lohuizen a1b916ed67 message/pipeline: further restructuring
- prepares to move more code out of gotext
- accumulating results of operations in State
  make it easier to add generic pipeline actions
  and reuse state between operations

Change-Id: I8a109075348c03bfd05359635a20e668fcaf09e0
Reviewed-on: https://go-review.googlesource.com/83655
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-15 14:17:12 +00:00
Marcel van Lohuizen f21a4dfb5e all: upgrade to CLDR 32
Change-Id: I80ba02e97f8c9a6bc364cf8679b90aee13a1ce23
Reviewed-on: https://go-review.googlesource.com/82905
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:08:43 +00:00
Marcel van Lohuizen d5f0155fc1 internal/cldrtree: included in gen.go
Change-Id: I149d44933ef36e48961e4d405267f578950ba7ac
Reviewed-on: https://go-review.googlesource.com/82906
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:06:06 +00:00
Marcel van Lohuizen 681d1c0c9a language/display: change tests to prepare for CLDR 32
Change-Id: I89e9b78227ff4db60efca2308d06fb1750844d64
Reviewed-on: https://go-review.googlesource.com/82904
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:05:14 +00:00
Marcel van Lohuizen 1516014cc0 language: exclude data case to prepare for CLDR 32
Change-Id: I11d25e966d6b92a1b3c8fa111ee3c5d8c3fcdc65
Reviewed-on: https://go-review.googlesource.com/82903
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:03:07 +00:00
Marcel van Lohuizen 99af6ec1d4 internal/number: preperation for CLDR 32
change index size

Change-Id: Iff47132d6d5d4c72abb1e8005fc0d1ca0eae2bd8
Reviewed-on: https://go-review.googlesource.com/82902
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:02:19 +00:00
Marcel van Lohuizen 6097f7ad59 gen.go: fix dependencies to fix CLDR 32 generation
Change-Id: I5dcfcc2c7cbbd5c3415d1c98a7a3a216725f575d
Reviewed-on: https://go-review.googlesource.com/82901
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 13:01:39 +00:00
Marcel van Lohuizen 90c7ecd090 currency: add entry in preparation for CLDR32
Change-Id: I28678a95c79619a71c0a622476dfb0913f1c723e
Reviewed-on: https://go-review.googlesource.com/82900
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-14 12:59:13 +00:00
Marcel van Lohuizen c4d099d611 all: support multiple versions of Unicode
Different Go compilers support different versions of Unicode.
In general, one should match the version of x/text to match
the Unicode version of the Go core. This is quite painful and
restrictive in practice.

x/text now supports multiple versions of Unicode concurrently
which are selected based on the Go compiler used (from 1.7).

Change-Id: I9a999bf603872a88932740ca7eb518c247519e06
Reviewed-on: https://go-review.googlesource.com/83235
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2017-12-13 10:25:48 +00:00
Marcel van Lohuizen 3b24cac7bc message/pipeline: converted to API
and changed cmd/gotext to use it.

Change-Id: I418957cfcbcad3acb2ebcd2f65c88a43e5e7f254
Reviewed-on: https://go-review.googlesource.com/82236
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-09 17:13:08 +00:00
Marcel van Lohuizen bbb8cca384 message/pipeline: copy over files from cmd/gotext
Most of the code will be turned into a package.

Change-Id: I47609e5afb176e42d3b0b29bfa04cca23ab6867f
Reviewed-on: https://go-review.googlesource.com/82235
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-09 17:12:35 +00:00
Marcel van Lohuizen 576e5cf351 cmd/gotext: add generate command
Change-Id: I528e05f5ddb2c903cbe6136bed5b31fe867510b1
Reviewed-on: https://go-review.googlesource.com/82199
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-09 17:12:16 +00:00
Marcel van Lohuizen 595fa11735 cmd/gotext: distinguish between key and id
The id of the translation and the key that is used at
runtime to look up the translation are not the same.
The id is used for tracking and linking messages.
The key is used for lookup internally.

Change-Id: I26cac35fb421ee8227fd8b0b5a712a752c4f5f5e
Reviewed-on: https://go-review.googlesource.com/82202
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-09 17:11:44 +00:00
Marcel van Lohuizen a15b1bf5f1 cmd/gotext: require translation field
This makes it easier to start typing.

Change-Id: I890c7533e021ab99cec2a0b51de4f743007e33e3
Reviewed-on: https://go-review.googlesource.com/82201
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-09 17:10:45 +00:00
Marcel van Lohuizen be25de41fa cmd/gotext: standardize error handling
Change-Id: I2aed475d975af4e084a0a17547d424493fd7c70b
Reviewed-on: https://go-review.googlesource.com/82198
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-07 10:46:13 +00:00
Marcel van Lohuizen 3112fffd53 cmd/gotext: factor out common loader code
Change-Id: I5aa45d17c01c6aacf2b9d10cdeea5b92ae79c246
Reviewed-on: https://go-review.googlesource.com/82197
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-07 10:45:02 +00:00
Marcel van Lohuizen 077fb02d38 cmd/gotext: prettify JSON for Text type
Change-Id: Ib1e17f9213caf7e180d2e30491f13095fa0b9b8f
Reviewed-on: https://go-review.googlesource.com/82196
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-07 10:44:37 +00:00
Marcel van Lohuizen f43056082a cmd/gotext: redo dir structure and file names
Naming is now more conventional (see e.g. Gobuffalo).
- create example translation files for multiple languages
- default/extraction language is included in supported list
- example uses message.MatchLanguage
- standardized generation header
- File -> Locale; now used for all files

Change-Id: Icfb682705e103a9382a70be8aaec849fc3d8b726
Reviewed-on: https://go-review.googlesource.com/82195
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-07 10:03:15 +00:00
Marcel van Lohuizen 2a914596d5 message: link in plural package by default
This makes plural messages work out of the box for
generated catalogs.

Change-Id: Ifc7e457d7bf909dcf067f749366e8a49ac31f6b6
Reviewed-on: https://go-review.googlesource.com/81836
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-07 09:49:49 +00:00
Marcel van Lohuizen 97fde44750 message/catalog: add Matcher method to Catalog
Matchers pretty much exclusively will have to be created
through a Catalog, if one uses one.

One of the main goals of this, though, is to facilitate
the usage of automatically generated catalogs, which is
otherwise tricky.

Change-Id: I008254ce8b3e93c84b2a26d53117e2221c0f027e
Reviewed-on: https://go-review.googlesource.com/81835
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-07 09:40:12 +00:00
Marcel van Lohuizen b7c1ddf508 internal/number: fix bug in info lookup
fallback needs to be computed for both modes.
Latn data is elided from the tables, so check
for latin script at the root.

Change-Id: I6db954b9b76761380fec3b90fde962449536fa23
Reviewed-on: https://go-review.googlesource.com/81755
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-12-07 08:35:57 +00:00
Mikio Hara f9878be481 all: gofmt -w and remove execute bit from source files
Change-Id: I45fdc3a61153aaec775eb9f020fc4fc05df029bd
Reviewed-on: https://go-review.googlesource.com/82436
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07 05:08:07 +00:00
Marcel van Lohuizen 5796168070 cmd/gotext: extract messages in entire binary
Added examples.
Also improved Placeholder name extraction.

Change-Id: I3f271156a1cd364ed4ec71d3e1f8ab8c48568baf
Reviewed-on: https://go-review.googlesource.com/80236
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-04 16:18:52 +00:00
Marcel van Lohuizen 23a60d0a9b cmd/gotext: move to Placeholder model
This more general model fits better with template-
style substitution, while still fitting well with
printf-style. It also allows hiding HTML and the like.

Modifies printf-substitution to be position-independent.

Change-Id: Ie8bd64c4fec9b8833bf8952bd02a8f3f56139e59
Reviewed-on: https://go-review.googlesource.com/79916
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-04 16:11:25 +00:00
Marcel van Lohuizen 747f3eb757 cmd/gotext: add rewrite command
Change-Id: Ibc6a957773086df50fb37634e1e79beb361e2914
Reviewed-on: https://go-review.googlesource.com/79578
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-04 16:09:58 +00:00
Marcel van Lohuizen 76c26bac1a cmd/gotext: allow const identifiers as keys
Change-Id: Idbcbed5103101e808ad7e7d2ac14de7128b25d62
Reviewed-on: https://go-review.googlesource.com/79577
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-04 16:03:19 +00:00
Marcel van Lohuizen e204928cdb cmd/gotext: improved extraction
- split extraction and translation data in two types
- rewrite fmt strings into translator-readable format
- more intelligent name picking, for instance:
  - use variable name for placeholders
  - if var is too short, use type name, if it differs
    from the underlying type.

Change-Id: I80ae9c165892491df6fcedc340d56a08269f47fe
Reviewed-on: https://go-review.googlesource.com/79237
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-04 16:01:25 +00:00