Generated documentation for release.
This commit is contained in:
parent
196b489256
commit
04780bfc02
|
@ -2,17 +2,19 @@
|
|||
{"scot/weft/i18n/core.clj":
|
||||
[null, 1, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, 1,
|
||||
null, null, null, null, 1, null, 1, null, 1, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, 1, null, 1, null, 1,
|
||||
null, null, null, null, null, true, 119, null, true, 119, 6, 16, 16,
|
||||
16, 8, null, 18, 18, null, 18, 18, 9, null, 19, 19, 15, 15, null,
|
||||
15, 4, 20, 15, 15, 0, 0, null, 0, 15, 15, null, 10, null, 0, 0,
|
||||
null, null, 1, null, null, null, null, null, null, null, null, 6, 6,
|
||||
5, 5, null, 5, 5, 1, null, null, 1, null, null, null, 13, 13, null,
|
||||
7, null, null, null, 1, null, null, null, null, null, null, null,
|
||||
null, null, null, 13, 13, 8, 8, 8, 13, 13, 13, 2, 11, 5, 5, 5, 5, 3,
|
||||
3, 3, null, null, 1, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3,
|
||||
3, 3, null, 1, null, null, 1, null, null, null, null, null, null,
|
||||
null, null, null, 1, null, 1, null, null, null, null, null, null,
|
||||
null, null, null, 1, 3, null, 1, null, 1]}}
|
||||
null, null, null, null, 1, null, 1, null, 1, null, 1, null, null, 1,
|
||||
null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, 1, null, 1, null, 1, null, null, null, null, null, true, 159,
|
||||
null, true, 159, 11, 22, 22, 22, 9, null, 24, 24, null, 24, 24, 10,
|
||||
null, 25, 25, 20, 20, null, 20, 5, 26, 20, 20, 0, 0, null, 0, 20,
|
||||
20, null, 11, null, 0, 0, null, null, 1, null, null, null, null,
|
||||
null, null, null, null, 10, 10, 10, 10, null, 10, 10, 0, null, null,
|
||||
1, null, null, null, 24, 24, null, 11, null, null, null, 1, null,
|
||||
null, null, null, null, null, null, null, null, null, 25, 25, 15,
|
||||
15, 15, 25, 25, 25, 6, 19, 10, 10, 10, 10, 5, 5, 5, null, null, 1,
|
||||
null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, 9, 9, 9, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, true, 7,
|
||||
null, 0, 0, 0, null, null, 2, 2, null, null, 1, null, null, null,
|
||||
null, null, null, null, null, null, 1, null, 1, null, null, null,
|
||||
null, null, null, null, null, null, null, 1, 8, 8, null, 7, 7, 7, 7,
|
||||
null, 5, 5]}}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><report><stats><packages value="1"/><methods value="367"/><srcfiles value="1"/><srclines value="93"/></stats><data><all name="total"><coverage type="class, %" value="0% (0/1)"/><coverage type="method, %" value="0% (0/1)"/><coverage type="block, %" value="91% (333/367)"/><coverage type="line, %" value="92% (86/93)"/><package name="scot.weft.i18n.core"><coverage type="class, %" value="0% (0/1)"/><coverage type="method, %" value="0% (0/1)"/><coverage type="block, %" value="91% (333/367)"/><coverage type="line, %" value="92% (86/93)"/></package></all></data></report>
|
||||
<?xml version="1.0" encoding="UTF-8"?><report><stats><packages value="1"/><methods value="413"/><srcfiles value="1"/><srclines value="106"/></stats><data><all name="total"><coverage type="class, %" value="0% (0/1)"/><coverage type="method, %" value="0% (0/1)"/><coverage type="block, %" value="82% (338/413)"/><coverage type="line, %" value="89% (94/106)"/><package name="scot.weft.i18n.core"><coverage type="class, %" value="0% (0/1)"/><coverage type="method, %" value="0% (0/1)"/><coverage type="block, %" value="82% (338/413)"/><coverage type="line, %" value="89% (94/106)"/></package></all></data></report>
|
|
@ -16,26 +16,26 @@
|
|||
</tr></thead>
|
||||
<tr>
|
||||
<td><a href="scot/weft/i18n/core.clj.html">scot.weft.i18n.core</a></td><td class="with-bar"><div class="covered"
|
||||
style="width:90.73569482288828%;
|
||||
float:left;"> 333 </div><div class="not-covered"
|
||||
style="width:9.264305177111716%;
|
||||
float:left;"> 34 </div></td>
|
||||
<td class="with-number">90.74 %</td>
|
||||
style="width:81.84019370460048%;
|
||||
float:left;"> 338 </div><div class="not-covered"
|
||||
style="width:18.159806295399516%;
|
||||
float:left;"> 75 </div></td>
|
||||
<td class="with-number">81.84 %</td>
|
||||
<td class="with-bar"><div class="covered"
|
||||
style="width:92.47311827956989%;
|
||||
float:left;"> 86 </div><div class="partial"
|
||||
style="width:2.150537634408602%;
|
||||
float:left;"> 2 </div><div class="not-covered"
|
||||
style="width:5.376344086021505%;
|
||||
float:left;"> 5 </div></td>
|
||||
<td class="with-number">94.62 %</td>
|
||||
<td class="with-number">216</td><td class="with-number">23</td><td class="with-number">93</td>
|
||||
style="width:88.67924528301887%;
|
||||
float:left;"> 94 </div><div class="partial"
|
||||
style="width:2.830188679245283%;
|
||||
float:left;"> 3 </div><div class="not-covered"
|
||||
style="width:8.49056603773585%;
|
||||
float:left;"> 9 </div></td>
|
||||
<td class="with-number">91.51 %</td>
|
||||
<td class="with-number">235</td><td class="with-number">24</td><td class="with-number">106</td>
|
||||
</tr>
|
||||
<tr><td>Totals:</td>
|
||||
<td class="with-bar"></td>
|
||||
<td class="with-number">90.74 %</td>
|
||||
<td class="with-number">81.84 %</td>
|
||||
<td class="with-bar"></td>
|
||||
<td class="with-number">94.62 %</td>
|
||||
<td class="with-number">91.51 %</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
024 "The default path within the resources space on which translation files
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
025 will be sought."
|
||||
025 will be sought. Deprecated, prefer `(:resource-path *config*)`."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
026 "i18n")
|
||||
|
@ -89,7 +89,7 @@
|
|||
028 (def ^:dynamic *default-language*
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
029 "The default language to seek."
|
||||
029 "The default language to seek. Deprecated, prefer `(:default-language *config*)`."
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
030 (-> (locale/get-default) locale/to-language-tag))
|
||||
|
@ -97,560 +97,617 @@
|
|||
<span class="blank" title="0 out of 0 forms covered">
|
||||
031
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
032 (def accept-language-grammar
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
032 (def ^:dynamic *config*
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
033 "Grammar for `Accept-Language` headers"
|
||||
033 "Extensible configuration for i18n."
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
034 {:default-language (-> (locale/get-default) locale/to-language-tag)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
034 "HEADER := SPECIFIER | SPECIFIERS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
035 SPECIFIERS:= SPECIFIER | SPECIFIER SPEC-SEP SPECIFIERS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
036 SPEC-SEP := #',\\s*';
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
037 SPECIFIER := LANGUAGE-TAG | LANGUAGE-TAG Q-SEP Q-VALUE;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
038 LANGUAGE-TAG := PRIMARY-TAG | PRIMARY-TAG '-' SUB-TAGS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
039 PRIMARY-TAG := #'[a-zA-Z]+';
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
040 SUB-TAGS := SUB-TAG | SUB-TAG '-' SUB-TAGS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
041 SUB-TAG := #'[a-zA-Z0-9]+';
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
042 Q-SEP := #';\\s*q='
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
043 Q-VALUE := '1' | #'0.[0-9]+';")
|
||||
035 :resource-path "i18n"})
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
044
|
||||
036
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
045 (def parse-accept-language-header
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
037 (def accept-language-grammar
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
046 "Parse an `Accept-Language` header"
|
||||
038 "Grammar for `Accept-Language` headers"
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
039 "HEADER := SPECIFIER | SPECIFIERS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
040 SPECIFIERS:= SPECIFIER | SPECIFIER SPEC-SEP SPECIFIERS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
041 SPEC-SEP := #',\\s*';
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
042 SPECIFIER := LANGUAGE-TAG | LANGUAGE-TAG Q-SEP Q-VALUE;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
043 LANGUAGE-TAG := PRIMARY-TAG | PRIMARY-TAG '-' SUB-TAGS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
044 PRIMARY-TAG := #'[a-zA-Z]+';
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
045 SUB-TAGS := SUB-TAG | SUB-TAG '-' SUB-TAGS;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
046 SUB-TAG := #'[a-zA-Z0-9]+';
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
047 Q-SEP := #';\\s*q='
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
048 Q-VALUE := '1' | #'0.[0-9]+';")
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
049
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
050 (def parse-accept-language-header
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
051 "Parse an `Accept-Language` header"
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
047 (insta/parser accept-language-grammar))
|
||||
052 (insta/parser accept-language-grammar))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
048
|
||||
053
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
049 (defn generate-accept-languages
|
||||
054 (defn generate-accept-languages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
050 "From a `parse-tree` generated by the `language-specifier-grammar`, generate
|
||||
055 "From a `parse-tree` generated by the `language-specifier-grammar`, generate
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
051 a list of maps each having a `:language` key, a `:preference` key and a
|
||||
056 a list of maps each having a `:language` key, a `:preference` key and a
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
052 `:qualifier` key."
|
||||
057 `:qualifier` key."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
053 {:doc/format :markdown}
|
||||
058 {:doc/format :markdown}
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
054 [parse-tree]
|
||||
059 [parse-tree]
|
||||
</span><br/>
|
||||
<span class="partial" title="1 out of 2 forms covered">
|
||||
055 (if
|
||||
060 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
056 (nil? parse-tree)
|
||||
061 (nil? parse-tree)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
057 nil
|
||||
062 nil
|
||||
</span><br/>
|
||||
<span class="partial" title="2 out of 4 forms covered">
|
||||
058 (case
|
||||
063 (case
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
059 (first parse-tree)
|
||||
064 (first parse-tree)
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
060 :HEADER (generate-accept-languages (second parse-tree))
|
||||
065 :HEADER (generate-accept-languages (second parse-tree))
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
061 :SPECIFIERS (cons
|
||||
066 :SPECIFIERS (cons
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
062 (generate-accept-languages (second parse-tree))
|
||||
067 (generate-accept-languages (second parse-tree))
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
063 (when (>= (count parse-tree) 3)
|
||||
068 (when (>= (count parse-tree) 3)
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
064 (generate-accept-languages (nth parse-tree 3))))
|
||||
069 (generate-accept-languages (nth parse-tree 3))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
065 :SPEC-SEP nil
|
||||
070 :SPEC-SEP nil
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
066 :SPECIFIER (assoc
|
||||
071 :SPECIFIER (assoc
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
067 (generate-accept-languages (second parse-tree))
|
||||
072 (generate-accept-languages (second parse-tree))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
068 :preference
|
||||
073 :preference
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
069 (if
|
||||
074 (if
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
070 (>= (count parse-tree) 3)
|
||||
075 (>= (count parse-tree) 3)
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
071 (generate-accept-languages (nth parse-tree 3))
|
||||
076 (generate-accept-languages (nth parse-tree 3))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
072 1))
|
||||
077 1))
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
073 :LANGUAGE-TAG (if
|
||||
078 :LANGUAGE-TAG (if
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
074 (>= (count parse-tree) 3)
|
||||
079 (>= (count parse-tree) 3)
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
075 (assoc
|
||||
080 (assoc
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
076 (generate-accept-languages (second parse-tree))
|
||||
081 (generate-accept-languages (second parse-tree))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
077 :qualifier
|
||||
082 :qualifier
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
078 (generate-accept-languages (nth parse-tree 3)))
|
||||
083 (generate-accept-languages (nth parse-tree 3)))
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
079 (generate-accept-languages (second parse-tree)))
|
||||
084 (generate-accept-languages (second parse-tree)))
|
||||
</span><br/>
|
||||
<span class="covered" title="7 out of 7 forms covered">
|
||||
080 :PRIMARY-TAG {:language (second parse-tree) :qualifier "*"}
|
||||
085 :PRIMARY-TAG {:language (second parse-tree) :qualifier "*"}
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
081 :SUB-TAGS (if
|
||||
086 :SUB-TAGS (if
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
082 (>= (count parse-tree) 3)
|
||||
087 (>= (count parse-tree) 3)
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 3 forms covered">
|
||||
083 (str
|
||||
088 (str
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 5 forms covered">
|
||||
084 (generate-accept-languages (second parse-tree))
|
||||
089 (generate-accept-languages (second parse-tree))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
085 "-"
|
||||
090 "-"
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 5 forms covered">
|
||||
086 (generate-accept-languages (nth parse-tree 3)))
|
||||
091 (generate-accept-languages (nth parse-tree 3)))
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
087 (generate-accept-languages (second parse-tree)))
|
||||
092 (generate-accept-languages (second parse-tree)))
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
088 :SUB-TAG (second parse-tree)
|
||||
093 :SUB-TAG (second parse-tree)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
089 :Q-SEP nil
|
||||
094 :Q-SEP nil
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
090 :Q-VALUE (read-string (second parse-tree))
|
||||
095 :Q-VALUE (read-string (second parse-tree))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
091 ;; default
|
||||
096 ;; default
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
092 (do
|
||||
097 (do
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 16 forms covered">
|
||||
093 (timbre/error "Unable to parse header.")
|
||||
098 (timbre/error "Unable to parse header.")
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
094 nil))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
095
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
096 (defn acceptable-languages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
097 "Generate an ordered list of acceptable languages, most-preferred first.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
098
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
099 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header.
|
||||
099 nil))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
100
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
101 Returns a list of maps as generated by `generate-accept-languages`, in descending order
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
101 (defn acceptable-languages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
102 of preference."
|
||||
102 "Generate an ordered list of acceptable languages, most-preferred first.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
103
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
103 {:doc/format :markdown}
|
||||
104 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
105
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
104 [accept-language-header]
|
||||
106 Returns a list of maps as generated by `generate-accept-languages`, in descending order
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
107 of preference."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
108 {:doc/format :markdown}
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
109 [accept-language-header]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
105 (let [parse-tree (parse-accept-language-header accept-language-header)]
|
||||
110 (let [parse-tree (parse-accept-language-header accept-language-header)]
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
106 (if (vector? parse-tree)
|
||||
111 (if (vector? parse-tree)
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
107 (reverse
|
||||
112 (reverse
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
108 (sort-by
|
||||
113 (sort-by
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
109 :preference
|
||||
114 :preference
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
110 (generate-accept-languages
|
||||
115 (generate-accept-languages
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
111 parse-tree)))
|
||||
116 parse-tree)))
|
||||
</span><br/>
|
||||
<span class="covered" title="21 out of 21 forms covered">
|
||||
112 (timbre/error "Failed to parse Accept-Language header '" accept-language-header "':\n" (str parse-tree)))))
|
||||
<span class="not-covered" title="0 out of 21 forms covered">
|
||||
117 (timbre/error "Failed to parse Accept-Language header '" accept-language-header "':\n" (str parse-tree)))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
113
|
||||
118
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
114
|
||||
119
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
115 (defn slurp-resource
|
||||
120 (defn slurp-resource
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
116 "Slurp the resource of this name and return its contents as a string; but if it doesn't
|
||||
121 "Slurp the resource of this name and return its contents as a string; but if it doesn't
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
117 exist log the fact and return nil, rather than throwing an exception."
|
||||
122 exist log the fact and return nil, rather than throwing an exception."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
118 [name]
|
||||
123 [name]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
119 (try
|
||||
124 (try
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
120 (slurp (io/resource name))
|
||||
125 (slurp (io/resource name))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
121 (catch Exception _
|
||||
126 (catch Exception _
|
||||
</span><br/>
|
||||
<span class="covered" title="20 out of 20 forms covered">
|
||||
122 (timbre/error (str "Resource at " name " does not exist."))
|
||||
127 (timbre/warn (str "Resource at " name " does not exist."))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
123 nil)))
|
||||
128 nil)))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
124
|
||||
129
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
125
|
||||
130
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
126 (defn find-language-file-name
|
||||
131 (defn find-language-file-name
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
127 "Find the name of a messages file on this resource path which matches this `language-spec`.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
128
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
129 * `language-spec` should be either a map as generated by `generate-accept-languages`, or
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
130 else a string;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
131 * `resource-path` should be the path name of the directory in which message files are stored,
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
132 within the resources on the classpath.
|
||||
132 "Find the name of a messages file on this resource path which matches this `language-spec`.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
133
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
134 Returns the name of an appropriate file if any is found, else nil."
|
||||
134 * `language-spec` should be either a map as generated by `generate-accept-languages`, or
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
135 {:doc/format :markdown}
|
||||
135 else a string;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
136 [language-spec resource-path]
|
||||
136 * `resource-path` should be the path name of the directory in which message files are stored,
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
137 within the resources on the classpath.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
138
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
139 Returns the name of an appropriate file if any is found, else nil."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
140 {:doc/format :markdown}
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
141 [language-spec resource-path]
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
137 (let [file-path (when
|
||||
142 (let [file-path (when
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
138 (string? language-spec)
|
||||
143 (string? language-spec)
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
139 (join
|
||||
144 (join
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
140 java.io.File/separator
|
||||
145 java.io.File/separator
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
141 [resource-path (str language-spec ".edn")]))
|
||||
146 [resource-path (str language-spec ".edn")]))
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
142 contents (when file-path (slurp-resource file-path))]
|
||||
147 contents (when file-path (slurp-resource file-path))]
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
143 (cond
|
||||
148 (cond
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
144 contents
|
||||
149 contents
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
145 file-path
|
||||
150 file-path
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
146 (map? language-spec)
|
||||
151 (map? language-spec)
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
147 (or
|
||||
152 (or
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
148 (find-language-file-name
|
||||
153 (find-language-file-name
|
||||
</span><br/>
|
||||
<span class="covered" title="9 out of 9 forms covered">
|
||||
149 (str (:language language-spec) "-" (:qualifier language-spec))
|
||||
154 (str (:language language-spec) "-" (:qualifier language-spec))
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
150 resource-path)
|
||||
155 resource-path)
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
151 (find-language-file-name
|
||||
156 (find-language-file-name
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
152 (:language language-spec)
|
||||
157 (:language language-spec)
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
153 resource-path)))))
|
||||
158 resource-path)))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
154
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
155
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
156 (defn raw-get-messages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
157 "Return the most acceptable messages collection we have given this `accept-language-header`.
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
158 Do not use this function directly, use the memoized variant `get-messages`, as performance
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
159 will be very much better.
|
||||
159
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
160
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
161 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header;
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
161 (defn raw-get-messages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
162 * `resource-path` should be the fully-qualified path name of the directory in which
|
||||
162 "Return the most acceptable messages collection we have given this `accept-language-header`.
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
163 message files are stored;
|
||||
163 Do not use this function directly, use the memoized variant `get-messages`, as performance
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
164 * `default-locale` should be a locale specifier to use if no acceptable locale can be
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
165 identified.
|
||||
164 will be very much better.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
166
|
||||
165
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
167 Returns a map of message keys to strings; if no useable file is found, returns nil."
|
||||
166 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
168 {:doc/format :markdown}
|
||||
167 * `resource-path` should be the fully-qualified path name of the directory in which
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
169 [^String accept-language-header ^String resource-path ^String default-locale]
|
||||
168 message files are stored;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
169 * `default-locale` should be a locale specifier to use if no acceptable locale can be
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
170 identified.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
171
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
172 Returns a map of message keys to strings; if no useable file is found, returns nil."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
173 {:doc/format :markdown}
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
174 [^String accept-language-header ^String resource-path ^String default-locale]
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
170 (let [file-path (first
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
171 (remove
|
||||
175 (let [file-paths (remove
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
172 nil?
|
||||
176 empty?
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
173 (map
|
||||
177 (map
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
174 #(find-language-file-name % resource-path)
|
||||
178 #(find-language-file-name % resource-path)
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
175 (acceptable-languages accept-language-header))))]
|
||||
179 (acceptable-languages accept-language-header)))
|
||||
</span><br/>
|
||||
<span class="covered" title="20 out of 20 forms covered">
|
||||
176 (timbre/debug (str "Found i18n file at '" file-path "'"))
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
180 default-path (join java.io.File/separator
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
177 (try
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
178 (read-string
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
179 (slurp-resource
|
||||
</span><br/>
|
||||
<span class="covered" title="5 out of 5 forms covered">
|
||||
180 (or
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
181 file-path
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
182 (join java.io.File/separator
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
183 [resource-path
|
||||
181 [resource-path
|
||||
</span><br/>
|
||||
<span class="covered" title="4 out of 4 forms covered">
|
||||
184 (str default-locale ".edn")]))))
|
||||
182 (str default-locale ".edn")])
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
185 (catch Exception any
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
183 paths (concat file-paths (list default-path))
|
||||
</span><br/>
|
||||
<span class="covered" title="19 out of 19 forms covered">
|
||||
186 (timbre/error (str "Failed to load internationalisation because " (.getMessage any)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
187 nil))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
188
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
189 (def get-messages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
190 "Return the most acceptable messages collection we have given this `accept-language-header`
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
191
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
192 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
193 * `resource-path` should be the fully-qualified path name of the directory in which
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
194 message files are stored;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
195 * `default-locale` should be a locale specifier to use if no acceptable locale can be
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
196 identified.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
197
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
198 Returns a map of message keys to strings.; if no useable file is found, returns nil."
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
184 text (first
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
199 (memoize raw-get-messages))
|
||||
185 (remove empty?
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
186 (map
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
187 slurp-resource
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
188 paths)))]
|
||||
</span><br/>
|
||||
<span class="covered" title="2 out of 2 forms covered">
|
||||
189 (if text
|
||||
</span><br/>
|
||||
<span class="partial" title="1 out of 2 forms covered">
|
||||
190 (try
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
191 (read-string text)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
192 (catch Exception any
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 16 forms covered">
|
||||
193 (timbre/error "Failed to load internationalisation because "
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 2 forms covered">
|
||||
194 (.getName (.getClass any))
|
||||
</span><br/>
|
||||
<span class="not-covered" title="0 out of 1 forms covered">
|
||||
195 (.getMessage any))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
196 nil))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
197 ;; else
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
198 (doall
|
||||
</span><br/>
|
||||
<span class="covered" title="17 out of 17 forms covered">
|
||||
199 (timbre/error "No valid i18n files found, not even default. Tried" paths)
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
200 nil))))
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
200
|
||||
201
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
201 (def get-message
|
||||
202 (def get-messages
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
202 "Return the message keyed by this `token` from the most acceptable messages collection
|
||||
203 "Return the most acceptable messages collection we have given this `accept-language-header`
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
204
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
203 we have given this `accept-language-header`.
|
||||
205 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
204
|
||||
206 * `resource-path` should be the fully-qualified path name of the directory in which
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
205 * `token` should be a clojure keyword identifying the message to be retrieved;
|
||||
207 message files are stored;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
206 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header;
|
||||
208 * `default-locale` should be a locale specifier to use if no acceptable locale can be
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
207 * `resource-path` should be the fully-qualified path name of the directory in which
|
||||
209 identified.
|
||||
</span><br/>
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
210
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
208 message files are stored;
|
||||
211 Returns a map of message keys to strings.; if no useable file is found, returns nil."
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
209 * `default-locale` should be a locale specifier to use if no acceptable locale can be
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
212 (memoize raw-get-messages))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
210 identified."
|
||||
<span class="blank" title="0 out of 0 forms covered">
|
||||
213
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
211 (fn ([^Keyword token ^String accept-language-header ^String resource-path ^String default-locale]
|
||||
</span><br/>
|
||||
<span class="covered" title="7 out of 7 forms covered">
|
||||
212 ((get-messages accept-language-header resource-path default-locale) token))
|
||||
214 (def get-message
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
213 ([^Keyword token ^String accept-language-header]
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
214 (get-message token accept-language-header *resource-path* *default-language*))
|
||||
215 "Return the message keyed by this `token` from the most acceptable messages collection
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
215 ([^Keyword token]
|
||||
216 we have given this `accept-language-header`, if passed, or the current default language
|
||||
</span><br/>
|
||||
<span class="covered" title="6 out of 6 forms covered">
|
||||
216 (get-message token nil *resource-path* *default-language*))))
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
217 otherwise. If no message is found, return the token.
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
218
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
219 * `token` should be a clojure keyword identifying the message to be retrieved;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
220 * `accept-language-header` should be the value of an RFC2616 `Accept-Language` header;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
221 * `resource-path` should be the fully-qualified path name of the directory in which
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
222 message files are stored;
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
223 * `default-locale` should be a locale specifier to use if no acceptable locale can be
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
224 identified."
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
225 (fn ([^Keyword token ^String accept-language-header ^String resource-path ^String default-locale]
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
226 (let [message (token (get-messages accept-language-header resource-path default-locale))]
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
227 (or message (name token))))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
228 ([^Keyword token ^String accept-language-header]
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
229 (get-message token
|
||||
</span><br/>
|
||||
<span class="covered" title="1 out of 1 forms covered">
|
||||
230 accept-language-header
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
231 (or (:resource-path *config*) *resource-path*)
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
232 (or (:default-language *config*) *default-language*)))
|
||||
</span><br/>
|
||||
<span class="not-tracked" title="0 out of 0 forms covered">
|
||||
233 ([^Keyword token]
|
||||
</span><br/>
|
||||
<span class="covered" title="3 out of 3 forms covered">
|
||||
234 (get-message token
|
||||
</span><br/>
|
||||
<span class="covered" title="8 out of 8 forms covered">
|
||||
235 (or (:default-language *config*) *default-language*)))))
|
||||
</span><br/>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<!DOCTYPE html PUBLIC ""
|
||||
"">
|
||||
<html><head><meta charset="UTF-8" /><title>Internationalisation 1.0.3-SNAPSHOT</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Internationalisation</span> <span class="project-version">1.0.3-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 current"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>internationalisation</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1 "><a href="scot.weft.i18n.core.html"><div class="inner"><span>scot.weft.i18n.core</span></div></a></li></ul></div><div class="namespace-index" id="content"><h1><span class="project-title"><span class="project-name">Internationalisation</span> <span class="project-version">1.0.3-SNAPSHOT</span></span></h1><h5 class="license">Released under the <a href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License</a></h5><div class="doc"><p>Internationalisation library for Clojure.</p></div><h2>Installation</h2><p>To install, add the following dependency to your project or build file:</p><pre class="deps">[org.clojars.simon_brooke/internationalisation "1.0.3-SNAPSHOT"]</pre><h2>Topics</h2><ul class="topics"><li><a href="intro.html">internationalisation</a></li></ul><h2>Namespaces</h2><div class="namespace"><h3><a href="scot.weft.i18n.core.html">scot.weft.i18n.core</a></h3><div class="doc"><div class="markdown"><p>Internationalisation.</p></div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="scot.weft.i18n.core.html#var-*default-language*">*default-language*</a> </li><li> <a href="scot.weft.i18n.core.html#var-*resource-path*">*resource-path*</a> </li><li> <a href="scot.weft.i18n.core.html#var-accept-language-grammar">accept-language-grammar</a> </li><li> <a href="scot.weft.i18n.core.html#var-acceptable-languages">acceptable-languages</a> </li><li> <a href="scot.weft.i18n.core.html#var-find-language-file-name">find-language-file-name</a> </li><li> <a href="scot.weft.i18n.core.html#var-generate-accept-languages">generate-accept-languages</a> </li><li> <a href="scot.weft.i18n.core.html#var-get-message">get-message</a> </li><li> <a href="scot.weft.i18n.core.html#var-get-messages">get-messages</a> </li><li> <a href="scot.weft.i18n.core.html#var-parse-accept-language-header">parse-accept-language-header</a> </li><li> <a href="scot.weft.i18n.core.html#var-raw-get-messages">raw-get-messages</a> </li><li> <a href="scot.weft.i18n.core.html#var-slurp-resource">slurp-resource</a> </li></ul></div></div></div></body></html>
|
||||
<html><head><meta charset="UTF-8" /><title>Internationalisation 1.0.5</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Internationalisation</span> <span class="project-version">1.0.5</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 current"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="intro.html"><div class="inner"><span>internationalisation</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1 "><a href="scot.weft.i18n.core.html"><div class="inner"><span>scot.weft.i18n.core</span></div></a></li></ul></div><div class="namespace-index" id="content"><h1><span class="project-title"><span class="project-name">Internationalisation</span> <span class="project-version">1.0.5</span></span></h1><h5 class="license">Released under the <a href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License</a></h5><div class="doc"><p>Internationalisation library for Clojure.</p></div><h2>Installation</h2><p>To install, add the following dependency to your project or build file:</p><pre class="deps">[org.clojars.simon_brooke/internationalisation "1.0.5"]</pre><h2>Topics</h2><ul class="topics"><li><a href="intro.html">internationalisation</a></li></ul><h2>Namespaces</h2><div class="namespace"><h3><a href="scot.weft.i18n.core.html">scot.weft.i18n.core</a></h3><div class="doc"><div class="markdown"><p>Internationalisation.</p></div></div><div class="index"><p>Public variables and functions:</p><ul><li> <a href="scot.weft.i18n.core.html#var-*config*">*config*</a> </li><li> <a href="scot.weft.i18n.core.html#var-*default-language*">*default-language*</a> </li><li> <a href="scot.weft.i18n.core.html#var-*resource-path*">*resource-path*</a> </li><li> <a href="scot.weft.i18n.core.html#var-accept-language-grammar">accept-language-grammar</a> </li><li> <a href="scot.weft.i18n.core.html#var-acceptable-languages">acceptable-languages</a> </li><li> <a href="scot.weft.i18n.core.html#var-find-language-file-name">find-language-file-name</a> </li><li> <a href="scot.weft.i18n.core.html#var-generate-accept-languages">generate-accept-languages</a> </li><li> <a href="scot.weft.i18n.core.html#var-get-message">get-message</a> </li><li> <a href="scot.weft.i18n.core.html#var-get-messages">get-messages</a> </li><li> <a href="scot.weft.i18n.core.html#var-parse-accept-language-header">parse-accept-language-header</a> </li><li> <a href="scot.weft.i18n.core.html#var-raw-get-messages">raw-get-messages</a> </li><li> <a href="scot.weft.i18n.core.html#var-slurp-resource">slurp-resource</a> </li></ul></div></div></div></body></html>
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html PUBLIC ""
|
||||
"">
|
||||
<html><head><meta charset="UTF-8" /><title>internationalisation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Internationalisation</span> <span class="project-version">1.0.3-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>internationalisation</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1 "><a href="scot.weft.i18n.core.html"><div class="inner"><span>scot.weft.i18n.core</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#internationalisation" name="internationalisation"></a>internationalisation</h1>
|
||||
<html><head><meta charset="UTF-8" /><title>internationalisation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Internationalisation</span> <span class="project-version">1.0.5</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 current"><a href="intro.html"><div class="inner"><span>internationalisation</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1 "><a href="scot.weft.i18n.core.html"><div class="inner"><span>scot.weft.i18n.core</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#internationalisation" name="internationalisation"></a>internationalisation</h1>
|
||||
<p>A Clojure library designed to provide simple interationalisation of user-facing messages.</p>
|
||||
<h2><a href="#usage" name="usage"></a>Usage</h2>
|
||||
<p>To use this library in your project, add the following leiningen dependency:</p>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue