firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Add const file for string

Open codeithuman opened this issue 8 years ago • 4 comments

How should we manage strings within our phoenix applications? Flash messages, error messages, validation messages, etc.

codeithuman avatar Jul 06 '17 19:07 codeithuman

If these are user facing strings then I think we should go with some type of internationalization. https://hexdocs.pm/gettext/Gettext.html Seems to be what Phoenix includes by default.

More info: https://medium.com/@erichkist/using-gettext-to-internationalize-a-phoenix-application-ceb410407ea5

ryanlntn avatar Jul 06 '17 19:07 ryanlntn

@codeithuman Jumping on to what @ryanlntn said, I think I18n is the route we should go.

linguist is also an option if we want something a bit simpler than gettext.

silasjmatson avatar Jul 06 '17 19:07 silasjmatson

Totally down with linguist too. I'd prefer to work in plain elixir code. There are some advantages to Gettext though like the mix gettext.extract --merge task to automatically sync all existing entries to .pot template files and merge them into locale-specific .po files. As far as I know linguist doesn't support this.

ryanlntn avatar Jul 06 '17 20:07 ryanlntn

Yeah, linguist is more of a key-value store than a full-on I18n solution.

silasjmatson avatar Jul 07 '17 00:07 silasjmatson