ilib-localematcher 1.3.1 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +2 -41
  2. package/lib/LocaleMatcher.js +1 -1
  3. package/lib/LocaleMatcher.js.map +1 -1
  4. package/lib/localematch.js +1 -1
  5. package/lib/localematch.js.map +1 -1
  6. package/package.json +110 -108
  7. package/src/LocaleMatcher.js +7 -7
  8. package/src/localematch.js +7 -1
  9. package/docs/LocaleMatcher.html +0 -1237
  10. package/docs/LocaleMatcher.js.html +0 -465
  11. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  19. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -978
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -1049
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  29. package/docs/ilibLocaleMatcher.md +0 -235
  30. package/docs/index.html +0 -84
  31. package/docs/scripts/collapse.js +0 -39
  32. package/docs/scripts/commonNav.js +0 -28
  33. package/docs/scripts/linenumber.js +0 -25
  34. package/docs/scripts/nav.js +0 -12
  35. package/docs/scripts/polyfill.js +0 -4
  36. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  37. package/docs/scripts/prettify/lang-css.js +0 -2
  38. package/docs/scripts/prettify/prettify.js +0 -28
  39. package/docs/scripts/search.js +0 -99
  40. package/docs/styles/jsdoc.css +0 -776
  41. package/docs/styles/prettify.css +0 -80
  42. package/lib/package.json +0 -1
@@ -1,1237 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
-
5
- <meta charset="utf-8">
6
- <title>LocaleMatcher - Documentation</title>
7
-
8
-
9
- <script src="scripts/prettify/prettify.js"></script>
10
- <script src="scripts/prettify/lang-css.js"></script>
11
- <!--[if lt IE 9]>
12
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
- <![endif]-->
14
- <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
- <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
- <script src="scripts/nav.js" defer></script>
17
-
18
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
- </head>
20
- <body>
21
-
22
- <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
- <label for="nav-trigger" class="navicon-button x">
24
- <div class="navicon"></div>
25
- </label>
26
-
27
- <label for="nav-trigger" class="overlay"></label>
28
-
29
- <nav >
30
-
31
-
32
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="LocaleMatcher.html">LocaleMatcher</a><ul class='methods'><li data-type='method'><a href="LocaleMatcher.html#getLikelyLocale">getLikelyLocale</a></li><li data-type='method'><a href="LocaleMatcher.html#getLikelyLocaleMinimal">getLikelyLocaleMinimal</a></li><li data-type='method'><a href="LocaleMatcher.html#getLocale">getLocale</a></li><li data-type='method'><a href="LocaleMatcher.html#getMacroLanguage">getMacroLanguage</a></li><li data-type='method'><a href="LocaleMatcher.html#getRegionContainment">getRegionContainment</a></li><li data-type='method'><a href="LocaleMatcher.html#match">match</a></li><li data-type='method'><a href="LocaleMatcher.html#smallestCommonRegion">smallestCommonRegion</a></li></ul></li></ul>
33
-
34
- </nav>
35
-
36
- <div id="main">
37
-
38
- <h1 class="page-title">LocaleMatcher</h1>
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
- <section>
47
-
48
- <header>
49
-
50
- <h2>
51
-
52
- LocaleMatcher
53
-
54
- </h2>
55
-
56
- <div class="class-description usertext">Represent a locale matcher instance, which is used
57
- to see which locales can be matched with each other in
58
- various ways.</div>
59
-
60
-
61
- </header>
62
-
63
- <article>
64
-
65
- <div class="container-overview">
66
-
67
-
68
-
69
-
70
- <h2>Constructor</h2>
71
-
72
-
73
- <h4 class="name" id="LocaleMatcher"><span class="type-signature"></span>new LocaleMatcher<span class="signature">(options)</span><span class="type-signature"></span></h4>
74
-
75
-
76
-
77
-
78
-
79
-
80
- <dl class="details">
81
-
82
- <dt class="tag-description">Description:</dt>
83
- <dd class="tag-description"><ul class="dummy"><li>Create a new locale matcher instance. This is used
84
- to see which locales can be matched with each other in
85
- various ways.<p>
86
-
87
- The options object may contain any of the following properties:
88
-
89
- <ul>
90
- <li><i>locale</i> - the locale instance or locale spec to match
91
- </ul></li></ul></dd>
92
-
93
-
94
-
95
- <dt class="tag-source">Source:</dt>
96
- <dd class="tag-source"><ul class="dummy"><li>
97
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line53">line 53</a>
98
- </li></ul></dd>
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
- </dl>
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
- <h5 class="h5-parameters">Parameters:</h5>
145
-
146
-
147
- <table class="params">
148
- <thead>
149
- <tr>
150
-
151
- <th>Name</th>
152
-
153
-
154
- <th>Type</th>
155
-
156
-
157
-
158
-
159
-
160
- <th class="last">Description</th>
161
- </tr>
162
- </thead>
163
-
164
- <tbody>
165
-
166
-
167
- <tr>
168
-
169
- <td class="name"><code>options</code></td>
170
-
171
-
172
- <td class="type">
173
-
174
-
175
- <span class="param-type">Object</span>
176
-
177
-
178
-
179
-
180
- </td>
181
-
182
-
183
-
184
-
185
-
186
- <td class="description last">parameters to initialize this matcher</td>
187
- </tr>
188
-
189
-
190
- </tbody>
191
- </table>
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
- </div>
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
- <h3 class="subsection-title">Methods</h3>
231
-
232
-
233
-
234
-
235
-
236
-
237
- <h4 class="name" id="getLikelyLocale"><span class="type-signature"></span>getLikelyLocale<span class="signature">()</span><span class="type-signature"> &rarr; {Locale}</span></h4>
238
-
239
-
240
-
241
-
242
-
243
-
244
- <dl class="details">
245
-
246
- <dt class="tag-description">Description:</dt>
247
- <dd class="tag-description"><ul class="dummy"><li>Return an Locale instance that is fully specified based on partial information
248
- given to the constructor of this locale matcher instance. For example, if the locale
249
- spec given to this locale matcher instance is simply "ru" (for the Russian language),
250
- then it will fill in the missing region and script tags and return a locale with
251
- the specifier "ru-Cyrl-RU". (ie. Russian language, Cyrillic, Russian Federation).
252
- Any one or two of the language, script, or region parts may be left unspecified,
253
- and the other one or two parts will be filled in automatically. If this
254
- class has no information about the given locale, then the locale of this
255
- locale matcher instance is returned unchanged.</li></ul></dd>
256
-
257
-
258
-
259
- <dt class="tag-source">Source:</dt>
260
- <dd class="tag-source"><ul class="dummy"><li>
261
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line132">line 132</a>
262
- </li></ul></dd>
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
280
-
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
- </dl>
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
-
318
-
319
-
320
-
321
-
322
- <h5 class="h5-returns">Returns:</h5>
323
-
324
-
325
- <div class="param-desc">
326
- the most likely completion of the partial locale given
327
- to the constructor of this locale matcher instance
328
- </div>
329
-
330
-
331
-
332
- <dl class="param-type">
333
- <dt>
334
- Type
335
- </dt>
336
- <dd>
337
-
338
- <span class="param-type">Locale</span>
339
-
340
-
341
-
342
- </dd>
343
- </dl>
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
- <h4 class="name" id="getLikelyLocaleMinimal"><span class="type-signature"></span>getLikelyLocaleMinimal<span class="signature">()</span><span class="type-signature"> &rarr; {Locale}</span></h4>
355
-
356
-
357
-
358
-
359
-
360
-
361
- <dl class="details">
362
-
363
- <dt class="tag-description">Description:</dt>
364
- <dd class="tag-description"><ul class="dummy"><li>Return an Locale instance that is specified based on partial information
365
- given to the constructor of this locale matcher instance but which leaves out any
366
- part of the locale specifier that is so common that it is understood. For example,
367
- if the locale
368
- spec given to this locale matcher instance is simply "ru" (for the Russian language),
369
- then it will fill in the missing region and/or script tags and return a locale with
370
- the specifier "ru-RU". (ie. Russian language, Russian Federation). Note that the
371
- default script "Cyrl" is left out because the vast majority of text written in
372
- Russian is written with the Cyrllic script, so that part of the locale is understood
373
- and is commonly left out.<p>
374
-
375
- Any one or two of the language, script, or region parts may be left unspecified,
376
- and the other one or two parts will be filled in automatically. If this
377
- class has no information about the given locale, then the locale of this
378
- locale matcher instance is returned unchanged.<p>
379
-
380
- This method returns the same information as getLikelyLocale but with the very common
381
- parts left out.</li></ul></dd>
382
-
383
-
384
-
385
- <dt class="tag-source">Source:</dt>
386
- <dd class="tag-source"><ul class="dummy"><li>
387
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line160">line 160</a>
388
- </li></ul></dd>
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
-
419
-
420
- </dl>
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
- <h5 class="h5-returns">Returns:</h5>
449
-
450
-
451
- <div class="param-desc">
452
- the most likely "minimal" completion of the partial locale given
453
- to the constructor of this locale matcher instance where the commonly understood
454
- parts are left out.
455
- </div>
456
-
457
-
458
-
459
- <dl class="param-type">
460
- <dt>
461
- Type
462
- </dt>
463
- <dd>
464
-
465
- <span class="param-type">Locale</span>
466
-
467
-
468
-
469
- </dd>
470
- </dl>
471
-
472
-
473
-
474
-
475
-
476
-
477
-
478
-
479
-
480
-
481
- <h4 class="name" id="getLocale"><span class="type-signature"></span>getLocale<span class="signature">()</span><span class="type-signature"> &rarr; {Locale|undefined}</span></h4>
482
-
483
-
484
-
485
-
486
-
487
-
488
- <dl class="details">
489
-
490
- <dt class="tag-description">Description:</dt>
491
- <dd class="tag-description"><ul class="dummy"><li>Return the locale used to construct this instance.</li></ul></dd>
492
-
493
-
494
-
495
- <dt class="tag-source">Source:</dt>
496
- <dd class="tag-source"><ul class="dummy"><li>
497
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line80">line 80</a>
498
- </li></ul></dd>
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
-
516
-
517
-
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
-
526
-
527
-
528
-
529
-
530
- </dl>
531
-
532
-
533
-
534
-
535
-
536
-
537
-
538
-
539
-
540
-
541
-
542
-
543
-
544
-
545
-
546
-
547
-
548
-
549
-
550
-
551
-
552
-
553
-
554
-
555
-
556
-
557
-
558
- <h5 class="h5-returns">Returns:</h5>
559
-
560
-
561
- <div class="param-desc">
562
- the locale for this matcher
563
- </div>
564
-
565
-
566
-
567
- <dl class="param-type">
568
- <dt>
569
- Type
570
- </dt>
571
- <dd>
572
-
573
- <span class="param-type">Locale</span>
574
- |
575
-
576
- <span class="param-type">undefined</span>
577
-
578
-
579
-
580
- </dd>
581
- </dl>
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
-
591
-
592
- <h4 class="name" id="getMacroLanguage"><span class="type-signature"></span>getMacroLanguage<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
593
-
594
-
595
-
596
-
597
-
598
-
599
- <dl class="details">
600
-
601
- <dt class="tag-description">Description:</dt>
602
- <dd class="tag-description"><ul class="dummy"><li>Return the macrolanguage associated with this locale. If the
603
- locale's language is not part of a macro-language, then the
604
- locale's language is returned as-is.</li></ul></dd>
605
-
606
-
607
-
608
- <dt class="tag-source">Source:</dt>
609
- <dd class="tag-source"><ul class="dummy"><li>
610
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line330">line 330</a>
611
- </li></ul></dd>
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
-
624
-
625
-
626
-
627
-
628
-
629
-
630
-
631
-
632
-
633
-
634
-
635
-
636
-
637
-
638
-
639
-
640
-
641
-
642
-
643
- </dl>
644
-
645
-
646
-
647
-
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655
-
656
-
657
-
658
-
659
-
660
-
661
-
662
-
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
- <h5 class="h5-returns">Returns:</h5>
672
-
673
-
674
- <div class="param-desc">
675
- the ISO code for the macrolanguage associated
676
- with this locale, or language of the locale
677
- </div>
678
-
679
-
680
-
681
- <dl class="param-type">
682
- <dt>
683
- Type
684
- </dt>
685
- <dd>
686
-
687
- <span class="param-type">string</span>
688
-
689
-
690
-
691
- </dd>
692
- </dl>
693
-
694
-
695
-
696
-
697
-
698
-
699
-
700
-
701
-
702
-
703
- <h4 class="name" id="getRegionContainment"><span class="type-signature"></span>getRegionContainment<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
704
-
705
-
706
-
707
-
708
-
709
-
710
- <dl class="details">
711
-
712
- <dt class="tag-description">Description:</dt>
713
- <dd class="tag-description"><ul class="dummy"><li>Return the list of regions that this locale is contained within. Regions are
714
- nested, so locales can be in multiple regions. (eg. US is in Northern North
715
- America, North America, the Americas, the World.) Most regions are specified
716
- using UN.49 region numbers, though some, like "EU", are letters. If the
717
- locale is underspecified, this method will use the most likely locale method
718
- to get the region first. For example, the locale "ja" (Japanese) is most
719
- likely "ja-JP" (Japanese for Japan), and the region containment info for Japan
720
- is returned.</li></ul></dd>
721
-
722
-
723
-
724
- <dt class="tag-source">Source:</dt>
725
- <dd class="tag-source"><ul class="dummy"><li>
726
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line354">line 354</a>
727
- </li></ul></dd>
728
-
729
-
730
-
731
-
732
-
733
-
734
-
735
-
736
-
737
-
738
-
739
-
740
-
741
-
742
-
743
-
744
-
745
-
746
-
747
-
748
-
749
-
750
-
751
-
752
-
753
-
754
-
755
-
756
-
757
-
758
-
759
- </dl>
760
-
761
-
762
-
763
-
764
-
765
-
766
-
767
-
768
-
769
-
770
-
771
-
772
-
773
-
774
-
775
-
776
-
777
-
778
-
779
-
780
-
781
-
782
-
783
-
784
-
785
-
786
-
787
- <h5 class="h5-returns">Returns:</h5>
788
-
789
-
790
- <div class="param-desc">
791
- an array of region specifiers that this locale is within
792
- </div>
793
-
794
-
795
-
796
- <dl class="param-type">
797
- <dt>
798
- Type
799
- </dt>
800
- <dd>
801
-
802
- <span class="param-type">Array.&lt;string></span>
803
-
804
-
805
-
806
- </dd>
807
- </dl>
808
-
809
-
810
-
811
-
812
-
813
-
814
-
815
-
816
-
817
-
818
- <h4 class="name" id="match"><span class="type-signature"></span>match<span class="signature">(locale)</span><span class="type-signature"> &rarr; {number}</span></h4>
819
-
820
-
821
-
822
-
823
-
824
-
825
- <dl class="details">
826
-
827
- <dt class="tag-description">Description:</dt>
828
- <dd class="tag-description"><ul class="dummy"><li>Return the degree that the given locale matches the current locale of this
829
- matcher. This method returns an integer from 0 to 100. A value of 100 is
830
- a 100% match, meaning that the two locales are exactly equivalent to each
831
- other. (eg. "ja-JP" and "ja-JP") A value of 0 means that there 0% match or
832
- that the two locales have nothing in common. (eg. "en-US" and "ja-JP") <p>
833
-
834
- Locale matching is not the same as equivalence, as the degree of matching
835
- is returned. (See Locale.equals for equivalence.)<p>
836
-
837
- The match score is calculated based on matching the 4 locale components,
838
- weighted by importance:
839
-
840
- <ul>
841
- <li> language - this accounts for 50% of the match score
842
- <li> region - accounts for 25% of the match score
843
- <li> script - accounts for 20% of the match score
844
- <li> variant - accounts for 5% of the match score
845
- </ul>
846
-
847
- The score is affected by the following things:
848
-
849
- <ul>
850
- <li> A large language score is given when the language components of the locales
851
- match exactly.
852
- <li> Higher language scores are given when the languages are linguistically
853
- close to each other, such as dialects.
854
- <li> A small score is given when two languages are in the same
855
- linguistic family, but one is not a dialect of the other, such as German
856
- and Dutch.
857
- <li> A large region score is given when two locales share the same region.
858
- <li> A smaller region score is given when one region is contained within
859
- another. For example, Hong Kong is part of China, so a moderate score is
860
- given instead of a full score.
861
- <li> A small score is given if two regions are geographically close to
862
- each other or are tied by history. For example, Ireland and Great Britain
863
- are both adjacent and tied by history, so they receive a moderate score.
864
- <li> A high script score is given if the two locales share the same script.
865
- The legibility of a common script means that there is some small kinship of the
866
- different languages.
867
- <li> A high variant score is given if the two locales share the same
868
- variant. Full score is given when both locales have no variant at all.
869
- <li> Locale components that are unspecified in both locales are given high
870
- scores.
871
- <li> Locales where a particular locale component is missing in only one
872
- locale can still match when the default for that locale component matches
873
- the component in the other locale. The
874
- default value for the missing component is determined using the likely locales
875
- data. (See getLikelyLocale()) For example, "en-US" and "en-Latn-US" receive
876
- a high script score because the default script for "en" is "Latn".
877
- </ul>
878
-
879
- The intention of this method is that it can be used to determine
880
- compatibility of locales. For example, when a user signs up for an
881
- account on a web site, the locales that the web site supports and
882
- the locale of the user's browser may differ, and the site needs to
883
- pick the best locale to show the user. Let's say the
884
- web site supports a selection of European languages such as "it-IT",
885
- "fr-FR", "de-DE", and "en-GB". The user's
886
- browser may be set to "it-CH". The web site code can then match "it-CH"
887
- against each of the supported locales to find the one with the
888
- highest score. In
889
- this case, the best match would be "it-IT" because it shares a
890
- language and script in common with "it-CH" and differs only in the region
891
- component. It is not a 100% match, but it is pretty good. The web site
892
- may decide if the match scores all fall
893
- below a chosen threshold (perhaps 50%?), it should show the user the
894
- default language "en-GB", because that is probably a better choice
895
- than any other supported locale.<p></li></ul></dd>
896
-
897
-
898
-
899
- <dt class="tag-source">Source:</dt>
900
- <dd class="tag-source"><ul class="dummy"><li>
901
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line242">line 242</a>
902
- </li></ul></dd>
903
-
904
-
905
-
906
-
907
-
908
-
909
-
910
-
911
-
912
-
913
-
914
-
915
-
916
-
917
-
918
-
919
-
920
-
921
-
922
-
923
-
924
-
925
-
926
-
927
-
928
-
929
-
930
-
931
-
932
-
933
-
934
- </dl>
935
-
936
-
937
-
938
-
939
-
940
-
941
-
942
-
943
-
944
-
945
-
946
-
947
-
948
- <h5 class="h5-parameters">Parameters:</h5>
949
-
950
-
951
- <table class="params">
952
- <thead>
953
- <tr>
954
-
955
- <th>Name</th>
956
-
957
-
958
- <th>Type</th>
959
-
960
-
961
-
962
-
963
-
964
- <th class="last">Description</th>
965
- </tr>
966
- </thead>
967
-
968
- <tbody>
969
-
970
-
971
- <tr>
972
-
973
- <td class="name"><code>locale</code></td>
974
-
975
-
976
- <td class="type">
977
-
978
-
979
- <span class="param-type">Locale</span>
980
-
981
-
982
-
983
-
984
- </td>
985
-
986
-
987
-
988
-
989
-
990
- <td class="description last">the other locale to match against the current one</td>
991
- </tr>
992
-
993
-
994
- </tbody>
995
- </table>
996
-
997
-
998
-
999
-
1000
-
1001
-
1002
-
1003
-
1004
-
1005
-
1006
-
1007
-
1008
-
1009
-
1010
-
1011
-
1012
- <h5 class="h5-returns">Returns:</h5>
1013
-
1014
-
1015
- <div class="param-desc">
1016
- an integer from 0 to 100 that indicates the degree to
1017
- which these locales match each other
1018
- </div>
1019
-
1020
-
1021
-
1022
- <dl class="param-type">
1023
- <dt>
1024
- Type
1025
- </dt>
1026
- <dd>
1027
-
1028
- <span class="param-type">number</span>
1029
-
1030
-
1031
-
1032
- </dd>
1033
- </dl>
1034
-
1035
-
1036
-
1037
-
1038
-
1039
-
1040
-
1041
-
1042
-
1043
-
1044
- <h4 class="name" id="smallestCommonRegion"><span class="type-signature"></span>smallestCommonRegion<span class="signature">(otherLocale)</span><span class="type-signature"> &rarr; {string}</span></h4>
1045
-
1046
-
1047
-
1048
-
1049
-
1050
-
1051
- <dl class="details">
1052
-
1053
- <dt class="tag-description">Description:</dt>
1054
- <dd class="tag-description"><ul class="dummy"><li>Find the smallest region that contains both the current locale and the other locale.
1055
- If the current or other locales are underspecified, this method will use the most
1056
- likely locale method
1057
- to get their regions first. For example, the locale "ja" (Japanese) is most
1058
- likely "ja-JP" (Japanese for Japan), and the region containment info for Japan
1059
- is checked against the other locale's region containment info.</li></ul></dd>
1060
-
1061
-
1062
-
1063
- <dt class="tag-source">Source:</dt>
1064
- <dd class="tag-source"><ul class="dummy"><li>
1065
- <a href="LocaleMatcher.js.html">LocaleMatcher.js</a>, <a href="LocaleMatcher.js.html#line372">line 372</a>
1066
- </li></ul></dd>
1067
-
1068
-
1069
-
1070
-
1071
-
1072
-
1073
-
1074
-
1075
-
1076
-
1077
-
1078
-
1079
-
1080
-
1081
-
1082
-
1083
-
1084
-
1085
-
1086
-
1087
-
1088
-
1089
-
1090
-
1091
-
1092
-
1093
-
1094
-
1095
-
1096
-
1097
-
1098
- </dl>
1099
-
1100
-
1101
-
1102
-
1103
-
1104
-
1105
-
1106
-
1107
-
1108
-
1109
-
1110
-
1111
-
1112
- <h5 class="h5-parameters">Parameters:</h5>
1113
-
1114
-
1115
- <table class="params">
1116
- <thead>
1117
- <tr>
1118
-
1119
- <th>Name</th>
1120
-
1121
-
1122
- <th>Type</th>
1123
-
1124
-
1125
-
1126
-
1127
-
1128
- <th class="last">Description</th>
1129
- </tr>
1130
- </thead>
1131
-
1132
- <tbody>
1133
-
1134
-
1135
- <tr>
1136
-
1137
- <td class="name"><code>otherLocale</code></td>
1138
-
1139
-
1140
- <td class="type">
1141
-
1142
-
1143
- <span class="param-type">string</span>
1144
- |
1145
-
1146
- <span class="param-type">Locale</span>
1147
-
1148
-
1149
-
1150
-
1151
- </td>
1152
-
1153
-
1154
-
1155
-
1156
-
1157
- <td class="description last">a locale specifier or a Locale instance to
1158
- compare against</td>
1159
- </tr>
1160
-
1161
-
1162
- </tbody>
1163
- </table>
1164
-
1165
-
1166
-
1167
-
1168
-
1169
-
1170
-
1171
-
1172
-
1173
-
1174
-
1175
-
1176
-
1177
-
1178
-
1179
-
1180
- <h5 class="h5-returns">Returns:</h5>
1181
-
1182
-
1183
- <div class="param-desc">
1184
- the region specifier of the smallest region containing both the
1185
- current locale and other locale
1186
- </div>
1187
-
1188
-
1189
-
1190
- <dl class="param-type">
1191
- <dt>
1192
- Type
1193
- </dt>
1194
- <dd>
1195
-
1196
- <span class="param-type">string</span>
1197
-
1198
-
1199
-
1200
- </dd>
1201
- </dl>
1202
-
1203
-
1204
-
1205
-
1206
-
1207
-
1208
-
1209
-
1210
-
1211
-
1212
-
1213
- </article>
1214
-
1215
- </section>
1216
-
1217
-
1218
-
1219
-
1220
-
1221
-
1222
- </div>
1223
-
1224
- <br class="clear">
1225
-
1226
- <footer>
1227
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Aug 13 2024 10:25:31 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
1228
- </footer>
1229
-
1230
- <script>prettyPrint();</script>
1231
- <script src="scripts/polyfill.js"></script>
1232
- <script src="scripts/linenumber.js"></script>
1233
-
1234
-
1235
-
1236
- </body>
1237
- </html>