Polyconseil / vue-gettext

Translate your Vue.js applications with gettext.
MIT License
278 stars 55 forks source link

Separate Output_dir and input #72

Closed Tails128 closed 6 years ago

Tails128 commented 6 years ago

Output_dir and input files in the Makefile would better be two different things:

let's assume someone's making a nuxt project: he/she needs both an output (in this case dev ) and multiple inputs (pages, plugins, middleware etc).

It is easy done by changing this


# On OSX the PATH variable isn't exported unless "SHELL" is also set, see: http://stackoverflow.com/a/25506676
SHELL = /bin/bash
NODE_BINDIR = ./node_modules/.bin
export PATH := $(NODE_BINDIR):$(PATH)

# Where to write the files generated by this makefile.
OUTPUT_DIR = dev

# Available locales for the app.
LOCALES = en_GB fr_FR it_IT

# Name of the generated .po files for each available locale.
LOCALE_FILES ?= $(patsubst %,$(OUTPUT_DIR)/locale/%/LC_MESSAGES/app.po,$(LOCALES))

GETTEXT_HTML_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.html' 2> /dev/null)
GETTEXT_JS_SOURCES = $(shell find $(OUTPUT_DIR) -name '*.vue' -o -name '*.js')

into this

# On OSX the PATH variable isn't exported unless "SHELL" is also set, see: http://stackoverflow.com/a/25506676
SHELL = /bin/bash
NODE_BINDIR = ./node_modules/.bin
export PATH := $(NODE_BINDIR):$(PATH)

# Where to write the files generated by this makefile.
OUTPUT_DIR = dev
INPUT_FILES = ./pages ./plugins ./static ./components ./middleware

# Available locales for the app.
LOCALES = en_GB it_IT

# Name of the generated .po files for each available locale.
LOCALE_FILES ?= $(patsubst %,$(OUTPUT_DIR)/locale/%/LC_MESSAGES/app.po,$(LOCALES))

GETTEXT_HTML_SOURCES = $(shell find $(INPUT_FILES) -name '*.vue' -o -name '*.html' 2> /dev/null)
GETTEXT_JS_SOURCES = $(shell find $(INPUT_FILES) -name '*.vue' -o -name '*.js')
kemar commented 6 years ago

@Tails128 it makes sense, thanx for the feedback.