From 9a94ea963c8fc19bca6c16e7c2fe0cbb37a82d84 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 11 Jun 2009 01:37:13 -0400 Subject: [PATCH] Enhancement - locale variant stripping - If a locale (locale=en-US) contains variant (locale=en-US.UTF8), then task ignores the variant. For now. --- ChangeLog | 2 -- src/Context.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b314b35c3..d0cec8f2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,8 +24,6 @@ (thanks to Federico Hernandez). + Removed obsolete DEVELOPERS file. The online support forums at http://taskwarrior.org will provide better information. - + Replaced website references with http://taskwarrior.org. - + Replaced contact references with support@taskwarrior.org. ------ old releases ------------------------------ diff --git a/src/Context.cpp b/src/Context.cpp index 0b03cc1cd..b1b1aa9e4 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -96,6 +96,12 @@ void Context::initialize () // allow all subsequent messages to be localizable. std::string location = expandPath (config.get ("data.location")); std::string locale = config.get ("locale"); + + // If there is a locale variant (en-US.), then strip it. + std::string::size_type period = locale.find ('.'); + if (period != std::string::npos) + locale = locale.substr (0, period); + if (locale != "") stringtable.load (location + "/strings." + locale);