How to deploy Angular multilanguage application on Google App Engine

user2010955

I've built my Angular 8 application, with angular/cli and i18n multilanguage support (with translations for English, Spanish, French).

So that I can build my app multiple times, one for each language and the build is saved in dist/my-app/en, dist/my-app/es, dist/my-app/fr and so on...

Now I'd like to deploy my app on Google App Engine, but I cannot understand what I should do/configure to deploy all my lang specific versions of my app.

I've already published my default (English) version on GAE and it works, but I don't know how/where to deploy all the other versions (es, fr, etc).

Should I use the dispatch file? What's your best way to do that?

Thanks!

Thierry Falvo

You can consider dist/my-app as your root folder regarding AppEngine.

  • Add an index.html inside this folder (to redirect to default locale depending on browser preferences or by let user choosing).
  • Deploy entire folder as one app in GAE.
  • Each localized app will be sub-folders, and then served by GAE as https:///xxxx.appspot.com/en/...

To build multiple application with multiple locales, check Angular official docs.

Each href should be set to locale:

"baseHref": "/en/",

Then, update app.yaml and handlers to serve all sub-folders.

For instance, this should looks like :

handlers:
- url: /fr/(.+)
  static_files: app/fr/index.html
  upload: app/fr/index.html
- url: /en/(.+)
  static_files: app/en/index.html
  upload: app/en/index.html
- url: /(.+)
  static_files: app/index.html
  upload: app/index.html
- url: /
  static_files: app/index.html
  upload: app/index.html

But I'm not an expert of handlers regexp, so it could be optimized I'm sure.

Deploy folder should looks like :

deploy
  app.yaml
  app
    index.html // page to propose user to select locale or auto redirect
    fr
      index.html
      bundles.js...
    en
      index.html
      bundles.js...

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How redeploy application on Google App Engine?

分類Dev

Unable to Deploy Java Application to App Engine

分類Dev

Deploy Google App Engine failed with timed out

分類Dev

Porting Application to Google App Engine

分類Dev

How can I deploy to Google App Engine an app that depends on a yarn workspaces without publishing the packages to a npm registry?

分類Dev

IP Address of Google App engine application

分類Dev

Database for Google App Engine and desktop application

分類Dev

Google App Engine git push-to-deploy insufficient privilages

分類Dev

How to deploy angular app supporting ssl

分類Dev

Google Compute Engine - Click to Deploy

分類Dev

How to use Composer in PHP Google App Engine

分類Dev

How to use Composer in PHP Google App Engine

分類Dev

Google App Engine gitpush-to-deploy不十分な特権

分類Dev

RSA in Google App Engine

分類Dev

google app engine and mongodb

分類Dev

Starting app engine modules in Google App Engine

分類Dev

How to deploy Angular Universal app to Node.js production server?

分類Dev

Deploy angular application in apache folder

分類Dev

App Engine split application into modules

分類Dev

How do I add --promote in Google App Engine?

分類Dev

How to limit google app engine instances to just one?

分類Dev

How to setup data fixtures in Google App Engine for Go

分類Dev

How to force Google App Engine [python] to use SSL (https)?

分類Dev

How to get an old Google App Engine SDK version

分類Dev

How to sanitize html blob uploads in python in Google App Engine?

分類Dev

How can I make url rewrite on google cloud app engine?

分類Dev

How to push existing docker image to google app-engine

分類Dev

Google App Engine (Python SDK) - How to catch db exceptions

分類Dev

How to use Joda LocalDate and DateTime in Google App Engine?

Related 関連記事

  1. 1

    How redeploy application on Google App Engine?

  2. 2

    Unable to Deploy Java Application to App Engine

  3. 3

    Deploy Google App Engine failed with timed out

  4. 4

    Porting Application to Google App Engine

  5. 5

    How can I deploy to Google App Engine an app that depends on a yarn workspaces without publishing the packages to a npm registry?

  6. 6

    IP Address of Google App engine application

  7. 7

    Database for Google App Engine and desktop application

  8. 8

    Google App Engine git push-to-deploy insufficient privilages

  9. 9

    How to deploy angular app supporting ssl

  10. 10

    Google Compute Engine - Click to Deploy

  11. 11

    How to use Composer in PHP Google App Engine

  12. 12

    How to use Composer in PHP Google App Engine

  13. 13

    Google App Engine gitpush-to-deploy不十分な特権

  14. 14

    RSA in Google App Engine

  15. 15

    google app engine and mongodb

  16. 16

    Starting app engine modules in Google App Engine

  17. 17

    How to deploy Angular Universal app to Node.js production server?

  18. 18

    Deploy angular application in apache folder

  19. 19

    App Engine split application into modules

  20. 20

    How do I add --promote in Google App Engine?

  21. 21

    How to limit google app engine instances to just one?

  22. 22

    How to setup data fixtures in Google App Engine for Go

  23. 23

    How to force Google App Engine [python] to use SSL (https)?

  24. 24

    How to get an old Google App Engine SDK version

  25. 25

    How to sanitize html blob uploads in python in Google App Engine?

  26. 26

    How can I make url rewrite on google cloud app engine?

  27. 27

    How to push existing docker image to google app-engine

  28. 28

    Google App Engine (Python SDK) - How to catch db exceptions

  29. 29

    How to use Joda LocalDate and DateTime in Google App Engine?

ホットタグ

アーカイブ