0
votes

I have translation service like this and I'm using assets/en_json or fr_json files but i want to move this files in cloud storage s3 bucket and i want to use in translation service how can i do that

    data: any = {};
    constructor(private http: HttpClient) {}
    use(lang: string): Promise<{}> {
        return new Promise<{}>((resolve, reject) => {
            lang = !lang ? localStorage.getItem('auth_user_language') : lang;
            const langPath = `assets/${lang || 'en_us'}.json`;
            this.http.get<{}>(langPath).subscribe(
                translation => {
                    this.data = Object.assign({}, translation || {});
                    resolve(this.data);
                },
                error => {
                    this.data = {};
                    resolve(this.data);
                }
            );
        });
    }
}```

1
Maybe this helps: dragonprogrammer.com/serve-angular-files-cloud-storage It is not s3 but I think it is the same direction - MoxxiManagarm

1 Answers

0
votes

I think this link could be helpful for you Transfer files from GCS to Amazon S3. It is important to keep in mind that this is not an official documentation of Google and it can work or not.