{"id":21584909,"url":"https://github.com/gilsdav/configurable-translate-http-loader","last_synced_at":"2026-05-22T05:03:55.229Z","repository":{"id":95197541,"uuid":"122192320","full_name":"gilsdav/configurable-translate-http-loader","owner":"gilsdav","description":"Be able to change prefix after \"useFactory\" call but before TranslateHttpLoader will be executed.","archived":false,"fork":false,"pushed_at":"2021-04-06T09:43:57.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T15:27:48.958Z","etag":null,"topics":["angular","async","asynchronous","configurable","http-loader","ngx-translate","translatehttploader"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gilsdav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-20T11:57:18.000Z","updated_at":"2021-04-06T09:43:59.000Z","dependencies_parsed_at":"2023-06-12T11:00:39.315Z","dependency_job_id":null,"html_url":"https://github.com/gilsdav/configurable-translate-http-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilsdav%2Fconfigurable-translate-http-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilsdav%2Fconfigurable-translate-http-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilsdav%2Fconfigurable-translate-http-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilsdav%2Fconfigurable-translate-http-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gilsdav","download_url":"https://codeload.github.com/gilsdav/configurable-translate-http-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189830,"owners_count":20412991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","async","asynchronous","configurable","http-loader","ngx-translate","translatehttploader"],"created_at":"2024-11-24T15:08:19.664Z","updated_at":"2026-05-22T05:03:50.186Z","avatar_url":"https://github.com/gilsdav.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# configurable-translate-http-loader\nBe able to change prefix after \"useFactory\" call but before TranslateHttpLoader will be called.\n\n## Why ? ##\nBecause I need to get async configuration that contains the prefix.\n\n**Before**\n\n```\n  export function createTranslateLoader(http: HttpClient) {\n    return new TranslateHttpLoader(http, '???', '.json'); // Don't know what to put as prefix because it's in config\n  }\n\n  @NgModule({\n    imports: [\n      TranslateModule.forRoot({\n          loader: {\n              provide: TranslateLoader,\n              useFactory: (createTranslateLoader),\n              deps: [HttpClient] // Can not add 'CONFIG' here because is optional\n          }\n      })\n    ]\n  })\n  export class AppModule {\n    constructor(@Optional()@Inject('CONFIG') config) {\n      // Have config.localesPath but too late to manage prefix of TranslateHttpLoader\n    }\n  }\n```\n\n**After**\n```\n  export function createTranslateLoader(http: HttpClient) {\n    return new ConfigurableTranslateHttpLoader(http, '', '.json'); // You can put anything for prefix here. It will not be used.\n  }\n\n  @NgModule({\n    imports: [\n      TranslateModule.forRoot({\n          loader: {\n              provide: TranslateLoader,\n              useFactory: (createTranslateLoader),\n              deps: [HttpClient]\n          }\n      })\n    ]\n  })\n  export class AppModule {\n    constructor(@Optional()@Inject('CONFIG') config) {\n      // Need minimum one call of this :\n      ConfigurableTranslateHttpLoader.localesPathSubject.next(config.localesPath); // Give path of locales and allow TranslateHttpLoader to answer\n    }\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilsdav%2Fconfigurable-translate-http-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgilsdav%2Fconfigurable-translate-http-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilsdav%2Fconfigurable-translate-http-loader/lists"}