Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukewestby/elm-string-interpolate
Inject values from a list into a template. Useful for i18n and templated copy.
https://github.com/lukewestby/elm-string-interpolate
Last synced: 10 days ago
JSON representation
Inject values from a list into a template. Useful for i18n and templated copy.
- Host: GitHub
- URL: https://github.com/lukewestby/elm-string-interpolate
- Owner: lukewestby
- License: mit
- Created: 2015-11-22T19:48:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-02T08:47:04.000Z (over 5 years ago)
- Last Synced: 2024-05-21T01:07:11.863Z (6 months ago)
- Language: Elm
- Size: 18.6 KB
- Stars: 30
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-ccamel - lukewestby/elm-string-interpolate - Inject values from a list into a template. Useful for i18n and templated copy. (Elm)
README
# String.Interpolate
[![Build Status](https://travis-ci.org/lukewestby/elm-string-interpolate.svg)](https://travis-ci.org/lukewestby/elm-string-interpolate)Inject values from a list into a template. Useful for i18n and templated copy.
## Documentation
`String.Interpolate` exports one function `interpolate : String -> List String
-> String`. The input string should use the format `"first arg: {0}, second
arg: {1}"` and so on.**Example:**
```elm
import String.Interpolate exposing(interpolate)output : String
output =
interpolate "My name is {0} {1}" ["Luke", "Westby"]main = show output {- "My name is Luke Westby" -}
```