https://github.com/ghidinelli/g11n.cfc
A ColdFusion Component that helps with Globalization (g11n) - Internationalization (i18n) and Localization (l10n)
https://github.com/ghidinelli/g11n.cfc
Last synced: about 11 hours ago
JSON representation
A ColdFusion Component that helps with Globalization (g11n) - Internationalization (i18n) and Localization (l10n)
- Host: GitHub
- URL: https://github.com/ghidinelli/g11n.cfc
- Owner: ghidinelli
- Created: 2015-11-11T07:04:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-11T07:20:34.000Z (over 10 years ago)
- Last Synced: 2023-04-04T14:13:19.882Z (about 3 years ago)
- Language: ColdFusion
- Size: 0 Bytes
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# g11n.cfc
A ColdFusion Component that helps with Globalization (g11n) - Internationalization (i18n) and Localization (l10n)
For a primer on Globalization with ColdFusion, check [https://gist.github.com/coldfusionPaul/3779416 this gist] from Paul Hastings (who knows a ton about g11n).
Some assumptions:
* Your content is in utf-8 and stored in the database as unicode
* You have `` everywhere
* You realize the built-in locale name and LS* functions are inadequate
Using g11n.cfc is easy:
```
g11n = createObject("component", "g11n").init(locale = "en_US", tzid = "US/Pacific");
writeOutput(g11n.getDateMask("short")); // M/d/yy h:mm a
writeOutput(g11n.formatDateTime(now(), "short")); // now() formatted as 'M/d/yy h:mm a' in Pacific time
writeOutput(g11n.formatCurrency(50000.50)); // $50,000.50
```
You can also pass the desired locale and timezone to most methods or change the default:
```
writeOutput(g11n.getDateMask(locale = "en_GB", mask = "short")); // dd/MM/yy HH:mm
g11n.setDefaultLocale("en_GB");
writeOutput(g11n.formatCurrency(50000.50)); // £50.000,50
```