62 lines
1.7 KiB
Diff
62 lines
1.7 KiB
Diff
|
From e15ca7b11c6da676097c1458df8306355044e817 Mon Sep 17 00:00:00 2001
|
||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||
|
Date: Fri, 19 Jul 2019 11:34:28 +0100
|
||
|
Subject: [PATCH 11/11] xgettext: Remove attempt to convert strings from "OCaml
|
||
|
strings" to strings.
|
||
|
|
||
|
---
|
||
|
ocaml-gettext/xgettext.ml | 20 ++++----------------
|
||
|
1 file changed, 4 insertions(+), 16 deletions(-)
|
||
|
|
||
|
diff --git a/ocaml-gettext/xgettext.ml b/ocaml-gettext/xgettext.ml
|
||
|
index 569d40d..111514c 100644
|
||
|
--- a/ocaml-gettext/xgettext.ml
|
||
|
+++ b/ocaml-gettext/xgettext.ml
|
||
|
@@ -63,19 +63,13 @@ type t = {
|
||
|
translated: SetString.t;
|
||
|
}
|
||
|
|
||
|
-let string_of_ocaml_string str =
|
||
|
- Scanf.sscanf
|
||
|
- (Printf.sprintf "\"%s\"" str)
|
||
|
- "%S"
|
||
|
- (fun s -> s)
|
||
|
-
|
||
|
let translations = ref { po_content = empty_po; translated = SetString.empty }
|
||
|
|
||
|
let default_textdomain = ref None
|
||
|
|
||
|
let current_file = ref ""
|
||
|
|
||
|
-let add_translation loc ocaml_singular plural_opt domain =
|
||
|
+let add_translation loc singular plural_opt domain =
|
||
|
let t = !translations in
|
||
|
|
||
|
let filepos =
|
||
|
@@ -85,19 +79,13 @@ let add_translation loc ocaml_singular plural_opt domain =
|
||
|
| fname -> fname in
|
||
|
fname, start.Lexing.pos_lnum
|
||
|
in
|
||
|
- let singular =
|
||
|
- string_of_ocaml_string ocaml_singular
|
||
|
- in
|
||
|
let translated =
|
||
|
- SetString.add ocaml_singular t.translated
|
||
|
+ SetString.add singular t.translated
|
||
|
in
|
||
|
let translated, translation =
|
||
|
match plural_opt with
|
||
|
- | Some ocaml_plural ->
|
||
|
- let plural =
|
||
|
- string_of_ocaml_string ocaml_plural
|
||
|
- in
|
||
|
- SetString.add ocaml_plural translated,
|
||
|
+ | Some plural ->
|
||
|
+ SetString.add plural translated,
|
||
|
{
|
||
|
po_comment_special = [];
|
||
|
po_comment_filepos = [filepos];
|
||
|
--
|
||
|
2.22.0
|
||
|
|