From f5a72dbee99cadd6b1498ffdaec087fa8e3f0a4a Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Thu, 18 Aug 2011 08:28:06 -0400 Subject: Different locales on different systems, handle --- .zshrc | 4 ++-- SUBSTS | 2 ++ dm | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.zshrc b/.zshrc index a4b8b57..51cadb0 100644 --- a/.zshrc +++ b/.zshrc @@ -36,8 +36,8 @@ #export LANG="en_CA.UTF-8" # ...as default language. #export LC_ALL="fr_CA.UTF-8" #export LANG="fr_CA.UTF-8" -export LC_ALL="es_ES.UTF-8" -export LANG="es_ES.UTF-8" +export LC_ALL="LOCALE" +export LANG="LOCALE" export TZ="America/Toronto" # Force our time zone this location. export EDITOR="vim" # Long live vim (as our editor). export NAME="Ryan Kavanagh" # Our name. diff --git a/SUBSTS b/SUBSTS index 38866ce..0790eed 100644 --- a/SUBSTS +++ b/SUBSTS @@ -17,3 +17,5 @@ XMONAD_DZEN_Y 0 SCREENLAYOUT epsilon-SAIL # Pipe major's email PM_EMAIL pipemajor@example.org +# Locale +LOCALE es_ES.UTF-8 diff --git a/dm b/dm index a55ba38..f9b8251 100755 --- a/dm +++ b/dm @@ -9,6 +9,7 @@ LOCAL_FILES = \ .netrc \ .offlineimaprc \ .xmonad/xmonad.hs \ + .zshrc \ # Files that are system independent. # IMPORTANT: directories must have trailing slash @@ -36,7 +37,6 @@ GLOBAL_FILES = \ .xmonad/ \ .zsh/ \ .zsh_logout \ - .zshrc \ bin/ \ get-val = $(shell awk '{if (match($$0, /$1/)) { print $$2 } }' $(SUBSTS_FILE)) @@ -51,6 +51,7 @@ SCREENLAYOUT = $(call get-val,SCREENLAYOUT) XMONAD_DZEN_W = $(call get-val,XMONAD_DZEN_W) XMONAD_DZEN_X = $(call get-val,XMONAD_DZEN_X) XMONAD_DZEN_Y = $(call get-val,XMONAD_DZEN_Y) +LOCALE = $(call get-val,LOCALE) # This target relies on GLOBAL_FILES being before LOCAL_FILES so that the # build/LOCAL_FILES targets overwrite what was copied in GLOBAL_FILES. @@ -89,6 +90,10 @@ build/.xmonad/xmonad.hs: .xmonad/xmonad.hs $(SUBSTS_FILE) -e 's/XMONAD_DZEN_X/$(XMONAD_DZEN_X)/g' \ -e 's/XMONAD_DZEN_y/$(XMONAD_DZEN_Y)/g' $< > $@ +build/.zshrc: .zshrc $(SUBSTS_FILE) + [ -d $(dir $@) ] || mkdir -p $(dir $@) + sed -e 's/LOCALE/$(LOCALE)/g' $< > $@ + build/%: % [ -d $(dir $@) ] || mkdir -p $(dir $@) rsync -a $< $@ -- cgit v1.2.3