Displaying 3 results from an estimated 3 matches for "langkey".
Did you mean:
lange
2014 Jan 30
2
[PATCH] builder: output translated notes
...>
printf "%-24s %s\n" (s_"Download size:") (human_size size);
);
- (match notes with
- | ("", notes) :: _ ->
+ let notes = List.fold_left (
+ fun acc lang ->
+ match List.filter (
+ fun (langkey, _) ->
+ match langkey with
+ | "C" -> lang = ""
+ | langkey -> langkey = lang
+ ) notes with
+ | (_, noteskey) :: _ -> noteskey :: acc
+ | [] -> acc
+ ) [] langs in
+ (mat...
2014 Jan 30
0
Re: [PATCH] builder: output translated notes
...you're defining
a value.
So I would have written this:
let match_or_empty n =
try Str.matched_group n loc with Not_found -> ""
in
> + let notes = List.fold_left (
> + fun acc lang ->
> + match List.filter (
> + fun (langkey, _) ->
> + match langkey with
> + | "C" -> lang = ""
> + | langkey -> langkey = lang
> + ) notes with
> + | (_, noteskey) :: _ -> noteskey :: acc
> + | [] -> acc
> +...
2014 Mar 11
3
[PATCH 1/2] builder: move some language-related code into a Languages module
...ev !l
+
+let languages () =
+ match Setlocale.setlocale Setlocale.LC_MESSAGES None with
+ | None -> [""]
+ | Some locale -> split_locale locale
+
+let find_notes languages notes =
+ let notes = List.fold_left (
+ fun acc lang ->
+ let res = List.filter (
+ fun (langkey, _) ->
+ match langkey with
+ | "C" -> lang = ""
+ | langkey -> langkey = lang
+ ) notes in
+ match res with
+ | (_, noteskey) :: _ -> noteskey :: acc
+ | [] -> acc
+ ) [] languages in
+ List.rev notes
diff --git a/...