GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — globalize-express/example at master · devangnegandhi/globalize-express

Expand file tree

/

example

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

example

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
locales
locales
 
 
views
views
 
 
README.md
README.md
 
 
config.js
config.js
 
 
index.js
index.js
 
 
package.json
package.json
 
 

README.md

Outline

globalize-express Example

Example app to demonstrate the use of globalize-express with node and express

We assume you know what node's Express and Mustache.js (or any other similar templating engine) is.

The demo is composed of the following files:

.
├── index.js
├── config.js
├── views
    └── example_page.html
└── locales
    ├── de.json
    ├── en.json
    └── fr.json

Run the demo

cd <to-example-dir>
npm install
npm run start

To view it in English

Simply go to http://localhost:3000/ on your browser after running the demo

  • In this demo, you will see all the text is in english (Which is the default)
  • You will also see the dates and numbers represented in the US english format

To view it in French

Simply go to http://localhost:3000/?lang=fr on your browser after running the demo

  • In this demo, you will see the HTML title and the page header in french.
  • You will see an un-transalated string too - this was to demonstrate the fallback mechanism in globalize in case a transalation is not provided (see this for more details)
  • Also, you will see the date and numbers represented in the France-french format

To view it in German

Simply go to http://localhost:3000/?lang=de on your browser after running the demo

  • In this demo, you will see the HTML title and the page header in german.
  • You will see an un-transalated string too - This was to demonstrate the fallback mechanism in globalize in case a transalation is not provided (see this for more details)
  • Also, you will see the date and numbers represented in the Germany-german format

NOTE: This example does not use browser cookies to select language, and hence we have to use the URL query string. But rest assured, if a cookies is present and is defined in the config file, it will pick it up.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.