Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Use i18n in flash message from actions when generating a resource #1428

Closed
ricardoseriani opened this issue Nov 2, 2018 · 0 comments
Closed
Labels
proposal A suggestion for a change, feature, enhancement, etc
Milestone

Comments

@ricardoseriani
Copy link
Contributor

Description

Please, use i18n in flash message from actions when generating a resource to avoid duplication.
For example, when generating a movie resource, it generates a locales/movies.en-us.yaml with default messages for create, update, destroy, but in the actions/movies.go not utilize it by default.

Steps to Reproduce the Problem

Please describe in painful detail what you did (so others can play along with you) to get to this point. This includes things like the exact command(s) you used, or the curl command you used, that sort of thing.

  1. Create a new buffalo project (buffalo new coke)
  2. Go inside the project folder and generate a new resource (like buffalo generate resource movie title)

Expected Behavior

Utilizes the generated locales/movies.en-us.yaml when flashing default messages on create, update, destroy

Actual Behavior

Not utilizes locales/movies.en-us.yaml, regenerating the messages in actions/movies.go, which make more difficult to utilize the i18n localization.

Info

Buffalo Version

v0.13.2

App Information

Pwd=/home/ricardoseriani/buffalo
Root=/home/ricardoseriani/buffalo
GoPath=/home/ricardoseriani/dev/go
Name=buffalo
Bin=bin/buffalo
PackagePkg=../../../buffalo
ActionsPkg=../../../buffalo/actions
ModelsPkg=../../../buffalo/models
GriftsPkg=../../../buffalo/grifts
VCS=git
WithPop=false
WithSQLite=false
WithDep=false
WithWebpack=false
WithYarn=false
WithDocker=true
WithGrifts=true
WithModules=false

Go Version

go version go1.11.1 linux/amd64

Go Env

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ricardoseriani/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ricardoseriani/dev/go"
GOPROXY=""
GORACE=""
GOROOT="/home/ricardoseriani/bin/go"
GOTMPDIR=""
GOTOOLDIR="/home/ricardoseriani/bin/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ricardoseriani/buffalo/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build458801615=/tmp/go-build -gno-record-gcc-switches"

Node Version

v8.12.0

NPM Version

6.4.1

Yarn Version

1.12.1

PostgreSQL Version

PostgreSQL Not Found

MySQL Version

MySQL Not Found

SQLite Version

3.11.0 2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f

Dep Version

could not find a Gopkg.toml file

Dep Status

could not find a Gopkg.toml file

go.mod

module github.com/gobuffalo/buffalo

require (
github.com/codegangsta/negroni v1.0.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.7.0
github.com/gobuffalo/buffalo-plugins v1.6.7
github.com/gobuffalo/buffalo-pop v1.1.8
github.com/gobuffalo/envy v1.6.7
github.com/gobuffalo/events v1.1.5
github.com/gobuffalo/fizz v1.0.16 // indirect
github.com/gobuffalo/genny v0.0.0-20181030163439-ed103521b8ec
github.com/gobuffalo/github_flavored_markdown v1.0.7
github.com/gobuffalo/httptest v1.0.2
github.com/gobuffalo/makr v1.1.5
github.com/gobuffalo/mw-basicauth v1.0.7
github.com/gobuffalo/mw-contenttype v0.0.0-20180802152300-74f5a47f4d56
github.com/gobuffalo/mw-csrf v0.0.0-20180802151833-446ff26e108b
github.com/gobuffalo/mw-forcessl v0.0.0-20180802152810-73921ae7a130
github.com/gobuffalo/mw-i18n v0.0.0-20181027200759-09e0c99be4d3
github.com/gobuffalo/mw-paramlogger v0.0.0-20181005191442-d6ee392ec72e
github.com/gobuffalo/mw-tokenauth v0.0.0-20181001105134-8545f626c189
github.com/gobuffalo/packd v0.0.0-20181031195726-c82734870264
github.com/gobuffalo/packr v1.17.0
github.com/gobuffalo/plush v3.7.22+incompatible
github.com/gobuffalo/pop v4.8.7+incompatible
github.com/gobuffalo/tags v2.0.11+incompatible
github.com/gobuffalo/x v0.0.0-20181025192250-1ef645d63fe8
github.com/gorilla/context v1.1.1
github.com/gorilla/mux v1.6.2
github.com/gorilla/sessions v1.1.3
github.com/markbates/deplist v1.0.5
github.com/markbates/grift v1.0.5
github.com/markbates/inflect v1.0.4
github.com/markbates/oncer v0.0.0-20181014194634-05fccaae8fc4
github.com/markbates/refresh v1.4.11
github.com/markbates/sigtx v1.0.0
github.com/monoculum/formam v0.0.0-20180901015400-4e68be1d79ba
github.com/pkg/errors v0.8.0
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.2.1
github.com/stretchr/testify v1.2.2
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc // indirect
golang.org/x/tools v0.0.0-20181101071927-45ff765b4815
gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4
)

@stanislas-m stanislas-m added the proposal A suggestion for a change, feature, enhancement, etc label Nov 3, 2018
@markbates markbates added this to the v0.14.0 milestone Nov 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
proposal A suggestion for a change, feature, enhancement, etc
Projects
None yet
Development

No branches or pull requests

3 participants