5 lines
47 KiB
JSON

{
"id": "api/localize/init/LocalizeFn",
"title": "LocalizeFn",
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/localize\", \"name\": \"@angular/localize\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/localize/init\", \"name\": \"@angular/localize/init\" } },\n { \"@type\": \"ListItem\", \"position\": 4, \"item\": { \"@id\": \"https://angular.io/api/localize/init/LocalizeFn\", \"name\": \"LocalizeFn\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/localize\">@angular/localize</a> > <a href=\"api/localize/init\">@angular/localize/init</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/localize/src/localize/src/localize.ts?message=docs(localize)%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/localize/src/localize/src/localize.ts\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"localizefn\">LocalizeFn<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/localize/init/LocalizeFn#localizefn\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label interface\">interface</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n \n \n </section>\n \n \n <section class=\"interface-overview\">\n<code-example language=\"ts\" hidecopy=\"true\">\ninterface LocalizeFn {\n <a class=\"code-anchor\" href=\"api/localize/init/LocalizeFn#translate\"><span class=\"member-name\">translate</span>?: TranslateFn</a>\n <a class=\"code-anchor\" href=\"api/localize/init/LocalizeFn#locale\"><span class=\"member-name\">locale</span>?: string</a>\n <a class=\"code-anchor\" href=\"api/localize/init/LocalizeFn#call\"><span class=\"member-name\"></span>(messageParts: TemplateStringsArray, ...expressions: readonly any[]): string</a>\n}\n</code-example>\n\n \n \n\n\n \n \n\n</section>\n\n \n\n \n \n \n<section class=\"instance-properties\">\n <h2 id=\"properties\">Properties<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/localize/init/LocalizeFn#properties\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"translate\"></a>\n <code class=\"\"><span class=\"member-name\">translate</span>?: TranslateFn</code>\n </td>\n <td>\n \n <p>A function that converts an input \"message with expressions\" into a translated \"message with\nexpressions\".</p>\n\n <p>The conversion may be done in place, modifying the array passed to the function, so\ndon't assume that this has no side-effects.</p>\n<p>The expressions must be passed in since it might be they need to be reordered for\ndifferent translations.</p>\n\n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"locale\"></a>\n <code class=\"\"><span class=\"member-name\">locale</span>?: string</code>\n </td>\n <td>\n \n <p>The current locale of the translated messages.</p>\n\n <p>The compile-time translation inliner is able to replace the following code:</p>\n<code-example>\ntypeof $localize !== \"undefined\" &#x26;&#x26; $localize.locale\n</code-example>\n<p>with a string literal of the current locale. E.g.</p>\n<code-example>\n\"fr\"\n</code-example>\n\n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n \n\n<section class=\"instance-methods\">\n <h2 id=\"methods\">Methods<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/localize/init/LocalizeFn#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"call\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"call-signature\">\n <i>call signature</i>\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/localize/init/LocalizeFn#call-signature\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/localize/src/localize/src/localize.ts?message=docs(localize)%3A%20describe%20your%20change...#L11-L11\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/localize/src/localize/src/localize.ts#L11-L11\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\"></span>(messageParts: TemplateStringsArray, ...expressions: readonly any[]): string</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>messageParts</code>\n </td>\n <td class=\"param-type\"><code>TemplateStringsArray</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>expressions</code>\n </td>\n <td class=\"param-type\"><code>readonly any[]</code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n <h6 class=\"no-anchor\" id=\"returns\">Returns</h6>\n <p><code>string</code></p>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n</section>\n\n\n \n\n\n </div>\n</article>\n\n<!-- links to this doc:\n-->\n<!-- links from this doc:\n - /api\n - api/localize\n - api/localize/init\n - api/localize/init/LocalizeFn#call\n - api/localize/init/LocalizeFn#call-signature\n - api/localize/init/LocalizeFn#locale\n - api/localize/init/LocalizeFn#localizefn\n - api/localize/init/LocalizeFn#methods\n - api/localize/init/LocalizeFn#properties\n - api/localize/init/LocalizeFn#translate\n - https://github.com/angular/angular/edit/master/packages/localize/src/localize/src/localize.ts?message=docs(localize)%3A%20describe%20your%20change...\n - https://github.com/angular/angular/edit/master/packages/localize/src/localize/src/localize.ts?message=docs(localize)%3A%20describe%20your%20change...#L11-L11\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/localize/src/localize/src/localize.ts\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/localize/src/localize/src/localize.ts#L11-L11\n-->"
}