Commit graph

35 commits

Author SHA1 Message Date
Matyas Horky
3a68971094 Detect translations in high-level structs
This patch adds .IsTranslated(), .IsTranslatedN() and related functions
to following objects:
- Po
- Mo
- locale
- gotext
and it creates helper interfaces in introspector.go.

This makes it possible to detect whether a string is translatable or not
during runtime.

Resolves #42
2023-04-12 17:15:46 +02:00
Matyas Horky
4ce6b50c65 Rename contexts to contextTranslations
This will keep the names consistent across the three members
2023-04-04 17:12:29 +02:00
jkoberg
9d5a301452 allow locale to work with a fs.FS
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2023-03-16 10:53:22 +01:00
Frederik Ring
771e397901
Fix arg type in docstring for (*Po).Parse
The Godoc string currently does not match the function's signature.
2021-09-19 11:46:13 +02:00
Andrew Williams
01a5eea7fa PO(T) Export, for message extraction
Allows stable round-tripping of PO(T) data across multiple message extraction passes.
Avoids canonicalisation of header keys, while preserving other semantics.
2020-09-29 17:58:59 +13:00
Jon Snyder
bb276626f3 move common po.go/mo.go code to domain.go
adjust tests to reduce duplication
2020-09-10 13:02:24 -07:00
Leonel Quinteros
823ca32c7a Fallback Po's missing plural translation using plural forms when available. Use western rule n==1 convention only on Locale object without Domain. Fixes #34 2019-10-21 14:43:48 -03:00
Leonel Quinteros
4cbf30d337 Make Locale and Po objects serializable. Closes #23 2018-09-07 18:14:38 -03:00
Leonel Quinteros
3c52f5c10b Make golint happy. Fixes #21 2018-05-29 12:46:11 -03:00
Josef Fröhle
4172a9c4a7 Update commits
Signed-off-by: Josef Fröhle <froehle@b1-systems.de>
2018-03-26 20:47:41 +02:00
Josef Fröhle
cd46239477 Create MO parser
Refactored a bit too, so we can use interfaces to take Mo and Po files

added fixtures

found that the parser for Po files have a bug... but it works... so not touched
2018-03-24 22:44:37 +01:00
Josef Fröhle
a19c5fd581 Create own plurals subpackage
fix Typo
2018-03-22 22:58:55 +01:00
Leonel Quinteros
7d86bb66fe Unify fmt.Sprintf behaviour on Po and Locale 2017-11-02 10:21:20 -03:00
Leonel Quinteros
1fc8dec04d Rewrite PO headers parsing and handling. Implement correct GNU gettext headers format. Fix tests. Fixes #10 2017-09-08 18:08:56 -03:00
Leonel Quinteros
4b94e83723 Properly handle singular vs plural defaults for untranslated strings. Fixes #9 2017-09-01 13:28:51 -03:00
Leonel Quinteros
756045ab5e Handle empty translation strings as untranslated as defined in https://www.gnu.org/software/gettext/manual/html_node/Untranslated-Entries.html. Fixes #9 2017-08-30 10:53:39 -03:00
Leonel Quinteros
cabefc2786 Fix: Remove plural default in Po Gets #8 2017-07-05 18:40:45 -03:00
Yasuhiro Matsumoto
9bcfe68591 use kinako instead of anko 2017-06-16 16:06:17 +09:00
Mattias Lundell
4a52c7709d Add support for multi-line msgid 2017-05-29 11:36:18 +02:00
Leonel Quinteros
0284dca059 Refactoring to make gocyclo happy 2016-08-08 11:36:05 -03:00
Leonel Quinteros
9a30bf7f45 Make golint happy 2016-08-08 09:54:52 -03:00
Leonel Quinteros
745244309c Go back to use mattn/anko repo 2016-07-19 14:12:06 -03:00
Leonel Quinteros
653444ba98 Fix race conditions using Anko. 2016-07-15 19:46:17 -03:00
Leonel Quinteros
74daa24696 Plural-Forms formula support. Headers parsing. Multiline strings support. 2016-07-15 19:04:59 -03:00
Leonel Quinteros
ea87d40cc2 Add Context (msgctxt) support 2016-06-26 15:43:54 -03:00
Leonel Quinteros
d6f4cbb2d5 Add race conditions tests. Fix races. 2016-06-24 17:45:12 -03:00
Leonel Quinteros
7f36e228f2 Improved docs 2016-06-24 17:09:37 -03:00
Leonel Quinteros
25256ca6c0 Improved docs 2016-06-24 17:09:34 -03:00
Leonel Quinteros
15e87b9351 Improved docs 2016-06-24 17:07:46 -03:00
Leonel Quinteros
ed080f71c3 Improved docs 2016-06-24 17:06:33 -03:00
Leonel Quinteros
2d31bca56e Improved docs 2016-06-24 17:04:46 -03:00
Leonel Quinteros
64c6ac19d9 Improve sync method. Improve docs. 2016-06-23 12:54:38 -03:00
Leonel Quinteros
982d029c78 Add support for plural forms 2016-06-23 11:41:38 -03:00
Leonel Quinteros
a7ccd4bbdb Add sync to PO parse 2016-06-19 19:47:28 -03:00
Leonel Quinteros
9107e9b75a Initial import 2016-06-19 19:36:33 -03:00