Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Jul 11, 2020
1 parent 49f0fcf commit 7260edf
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 55 deletions.
26 changes: 14 additions & 12 deletions docs/dependencies.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,33 @@
</ol>
<ul class="dependencies-list">
<li>
<b>@angular/animations</b> : 9.0.0</li>
<b>@angular/animations</b> : 10.0.2</li>
<li>
<b>@angular/common</b> : 9.0.0</li>
<b>@angular/common</b> : 10.0.2</li>
<li>
<b>@angular/compiler</b> : 9.0.0</li>
<b>@angular/compiler</b> : 10.0.2</li>
<li>
<b>@angular/core</b> : 9.0.0</li>
<b>@angular/core</b> : 10.0.2</li>
<li>
<b>@angular/forms</b> : 9.0.0</li>
<b>@angular/forms</b> : 10.0.2</li>
<li>
<b>@angular/platform-browser</b> : 9.0.0</li>
<b>@angular/platform-browser</b> : 10.0.2</li>
<li>
<b>@angular/platform-browser-dynamic</b> : 9.0.0</li>
<b>@angular/platform-browser-dynamic</b> : 10.0.2</li>
<li>
<b>@angular/router</b> : 9.0.0</li>
<b>@angular/router</b> : 10.0.2</li>
<li>
<b>rxjs</b> : 6.5.4</li>
<li>
<b>tslib</b> : ^1.10.0</li>
<b>tslib</b> : ^2.0.0</li>
<li>
<b>zone.js</b> : 0.10.2</li>
<b>zone.js</b> : 0.10.3</li>
<li>
<b>intl-pluralrules</b> : ^1.1.1</li>
<b>@formatjs/intl-getcanonicallocales</b> : ^1.2.10</li>
<li>
<b>@formatjs/intl-relativetimeformat</b> : ^4.5.9</li>
<b>@formatjs/intl-pluralrules</b> : ^3.0.2</li>
<li>
<b>@formatjs/intl-relativetimeformat</b> : ^6.0.2</li>
</ul>


Expand Down
16 changes: 10 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,30 +334,34 @@ <h2 id="intl-api">Intl API</h2>
src=&quot;https://polyfill.io/v3/polyfill.min.js?flags=gated&amp;features=Intl.~locale.en-US&quot;&gt;&lt;/script&gt;</code></pre></div><p>When specifying the <code>features</code>, you have to specify what languages to load.</p>
<p>Other polyfills:</p>
<ul>
<li>For <em>timezone</em>: <a href="https://github.com/formatjs/date-time-format-timezone">Intl.DateTimeFormat timezone</a></li>
<li>For <em>timeAgo</em> pipe and directive: <a href="https://www.npmjs.com/package/@formatjs/intl-relativetimeformat">Intl.RelativeTimeFormat</a></li>
<li><a href="https://formatjs.io/docs/polyfills">Format.JS</a></li>
</ul>
<p>The <code>L10nIntlService</code> also provides methods for other APIs, such as <em>Collator</em>, <em>PluralRules</em> and <em>ListFormat</em>.</p>
<h2 id="previous-versions">Previous versions</h2>
<ul>
<li><p><strong>Angular v9 (Angular l10n v9.3.0)</strong></p>
<ul>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v9">Branch</a></li>
</ul>
</li>
<li><p><strong>Angular v8 (Angular l10n v8.1.2)</strong></p>
<ul>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v8/docs">Branch</a></li>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v8">Branch</a></li>
</ul>
</li>
<li><p><strong>Angular v7 (Angular l10n v7.2.0)</strong></p>
<ul>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v7/docs">Branch</a></li>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v7">Branch</a></li>
</ul>
</li>
<li><p><strong>Angular v6 (Angular l10n v5.2.0)</strong></p>
<ul>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v6/docs">Branch</a></li>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v6">Branch</a></li>
</ul>
</li>
<li><p><strong>Angular v5 (Angular l10n v4.2.0)</strong></p>
<ul>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v5/docs">Branch</a></li>
<li><a href="https://github.com/robisim74/angular-l10n/tree/angular_v5">Branch</a></li>
</ul>
</li>
<li><p><strong>Angular v4 (Angular l10n v3.5.2)</strong></p>
Expand Down
4 changes: 2 additions & 2 deletions docs/injectables/L10nDefaultUserLanguage.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ <h3 id="methods">
switch (this.config.format) {
case &#x27;language&#x27;:
browserLanguage &#x3D; navigator.language.split(&#x27;-&#x27;)[0];
break
break;
case &#x27;language-region&#x27;:
browserLanguage &#x3D; navigator.language;
break
break;
}
}
return Promise.resolve(browserLanguage);
Expand Down
46 changes: 23 additions & 23 deletions docs/injectables/L10nIntlService.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h3 id="constructor">Constructor</h3>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:23</a></div>
<div class="io-line">Defined in <a href="" data-line="21" class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:21</a></div>
</td>
</tr>

Expand Down Expand Up @@ -205,8 +205,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="141"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:141</a></div>
<div class="io-line">Defined in <a href="" data-line="139"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:139</a></div>
</td>
</tr>

Expand Down Expand Up @@ -342,8 +342,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="34"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:34</a></div>
<div class="io-line">Defined in <a href="" data-line="32"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:32</a></div>
</td>
</tr>

Expand Down Expand Up @@ -478,8 +478,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="71"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:71</a></div>
<div class="io-line">Defined in <a href="" data-line="69"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:69</a></div>
</td>
</tr>

Expand Down Expand Up @@ -607,15 +607,15 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>formatRelativeTime(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, unit: <a href="../undefineds/Unit.html">Unit</a>, options?: Intl.RelativeTimeFormatOptions, language)</code>
<code>formatRelativeTime(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, unit: <a href="../undefineds/Unit.html">Unit</a>, options?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, language)</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="102"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:102</a></div>
<div class="io-line">Defined in <a href="" data-line="100"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:100</a></div>
</td>
</tr>

Expand Down Expand Up @@ -677,7 +677,7 @@ <h3 id="methods">
<tr>
<td>options</td>
<td>
<code>Intl.RelativeTimeFormatOptions</code>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>

<td>
Expand Down Expand Up @@ -750,8 +750,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="115"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:115</a></div>
<div class="io-line">Defined in <a href="" data-line="113"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:113</a></div>
</td>
</tr>

Expand Down Expand Up @@ -815,15 +815,15 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>list(list: string[], options?: Intl.ListFormatOptions, language)</code>
<code>list(list: string[], options?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, language)</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="170"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:170</a></div>
<div class="io-line">Defined in <a href="" data-line="168"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:168</a></div>
</td>
</tr>

Expand Down Expand Up @@ -867,7 +867,7 @@ <h3 id="methods">
<tr>
<td>options</td>
<td>
<code>Intl.ListFormatOptions</code>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>

<td>
Expand Down Expand Up @@ -940,8 +940,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="156"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:156</a></div>
<div class="io-line">Defined in <a href="" data-line="154"
class="link-to-prism">projects/angular-l10n/src/lib/services/l10n-intl.service.ts:154</a></div>
</td>
</tr>

Expand Down Expand Up @@ -1142,14 +1142,14 @@ <h3 id="methods">
public formatRelativeTime(
value: any,
unit: Unit,
options?: Intl.RelativeTimeFormatOptions,
options?: any,
language &#x3D; this.locale.dateLanguage || this.locale.language
): string {
if (!hasRelativeTimeFormat() || language &#x3D;&#x3D; null || language &#x3D;&#x3D;&#x3D; &#x27;&#x27;) return value;

value &#x3D; toNumber(value);

return new Intl.RelativeTimeFormat(language, options).format(value, unit);
return new (Intl as any).RelativeTimeFormat(language, options).format(value, unit);
}

public getCurrencySymbol(locale &#x3D; this.locale): string | undefined {
Expand Down Expand Up @@ -1207,11 +1207,11 @@ <h3 id="methods">
* @param options A Intl ListFormatOptions object
* @param language The current language
*/
public list(list: string[], options?: Intl.ListFormatOptions, language &#x3D; this.locale.language): string {
public list(list: string[], options?: any, language &#x3D; this.locale.language): string {
const values &#x3D; list.map(key &#x3D;&gt; this.translation.translate(key));
if (!hasListFormat() || language &#x3D;&#x3D; null || language &#x3D;&#x3D;&#x3D; &#x27;&#x27;) return values.toString();

return new Intl.ListFormat(language, options).format(values);
return new (Intl as any).ListFormat(language, options).format(values);
}

}
Expand Down
4 changes: 2 additions & 2 deletions docs/injectables/L10nUserLanguage.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ <h3 id="methods">
switch (this.config.format) {
case &#x27;language&#x27;:
browserLanguage &#x3D; navigator.language.split(&#x27;-&#x27;)[0];
break
break;
case &#x27;language-region&#x27;:
browserLanguage &#x3D; navigator.language;
break
break;
}
}
return Promise.resolve(browserLanguage);
Expand Down
4 changes: 2 additions & 2 deletions docs/js/search/search_index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/pipes/L10nTimeAgoAsyncPipe.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>transform(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, unit: <a href="../undefineds/Unit.html">Unit</a>, options?: Intl.RelativeTimeFormatOptions, language?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
<code>transform(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, unit: <a href="../undefineds/Unit.html">Unit</a>, options?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, language?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
</td>
</tr>

Expand Down Expand Up @@ -153,7 +153,7 @@ <h3 id="methods">
<tr>
<td>options</td>
<td>
<code>Intl.RelativeTimeFormatOptions</code>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>

<td>
Expand Down Expand Up @@ -211,7 +211,7 @@ <h3 id="methods">

constructor(protected intl: L10nIntlService) { }

public transform(value: any, language: string, unit: Unit, options?: Intl.RelativeTimeFormatOptions): string | null {
public transform(value: any, language: string, unit: Unit, options?: any): string | null {
if (value &#x3D;&#x3D; null || value &#x3D;&#x3D;&#x3D; &#x27;&#x27;) return null;

return this.intl.formatRelativeTime(value, unit, options, language);
Expand All @@ -229,7 +229,7 @@ <h3 id="methods">
super(translation, cdr);
}

public transform(value: any, unit: Unit, options?: Intl.RelativeTimeFormatOptions, language?: string): string | null {
public transform(value: any, unit: Unit, options?: any, language?: string): string | null {
if (value &#x3D;&#x3D; null || value &#x3D;&#x3D;&#x3D; &#x27;&#x27;) return null;

return this.intl.formatRelativeTime(value, unit, options, language);
Expand Down
8 changes: 4 additions & 4 deletions docs/pipes/L10nTimeAgoPipe.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>transform(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, language: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, unit: <a href="../undefineds/Unit.html">Unit</a>, options?: Intl.RelativeTimeFormatOptions)</code>
<code>transform(value: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>, language: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, unit: <a href="../undefineds/Unit.html">Unit</a>, options?: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
</td>
</tr>

Expand Down Expand Up @@ -169,7 +169,7 @@ <h3 id="methods">
<tr>
<td>options</td>
<td>
<code>Intl.RelativeTimeFormatOptions</code>
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
</td>

<td>
Expand Down Expand Up @@ -215,7 +215,7 @@ <h3 id="methods">

constructor(protected intl: L10nIntlService) { }

public transform(value: any, language: string, unit: Unit, options?: Intl.RelativeTimeFormatOptions): string | null {
public transform(value: any, language: string, unit: Unit, options?: any): string | null {
if (value &#x3D;&#x3D; null || value &#x3D;&#x3D;&#x3D; &#x27;&#x27;) return null;

return this.intl.formatRelativeTime(value, unit, options, language);
Expand All @@ -233,7 +233,7 @@ <h3 id="methods">
super(translation, cdr);
}

public transform(value: any, unit: Unit, options?: Intl.RelativeTimeFormatOptions, language?: string): string | null {
public transform(value: any, unit: Unit, options?: any, language?: string): string | null {
if (value &#x3D;&#x3D; null || value &#x3D;&#x3D;&#x3D; &#x27;&#x27;) return null;

return this.intl.formatRelativeTime(value, unit, options, language);
Expand Down

0 comments on commit 7260edf

Please sign in to comment.