Go Back   StepMania Forums > Help and Support > General questions
Connect with Facebook

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 2.75 average. Display Modes
Old 11-22-2009, 01:42 PM   #1
howl
Member
 
Join Date: Nov 2009
Posts: 90
howl is a 2 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default [Patch] Take the user environmet language if no previous one selected on UNIX

For the English people this doesn't do anything, but I noticed that windows version appeared in my language in first time I ran it on wine, so I wanted the same for the Linux version.

I think the $LANG environment variable is UNIX wide but not sure 100%, anyways if there is no $LANG variable English is assumed, so systems without it stay with the previous behavior:

Code:
Index: src/arch/ArchHooks/ArchHooks_Unix.cpp
===================================================================
--- src/arch/ArchHooks/ArchHooks_Unix.cpp (revision 28235)
+++ src/arch/ArchHooks/ArchHooks_Unix.cpp (working copy)
@@ -160,7 +160,17 @@
 
 RString ArchHooks::GetPreferredLanguage()
 {
-	return "en";
+	RString locale;
+
+	if(getenv("LANG"))
+	{
+		locale = getenv("LANG");
+		locale = locale.substr(0,2);
+	}
+	else
+		locale = "en";
+
+	return locale;
 }
 
 void ArchHooks_Unix::Init()
ChangeLog:
Code:
David Santamarķa Rogado (howl) (1):
      ArchHooks_Unix: Follow user's system language as default.

Last edited by howl; 11-22-2009 at 01:52 PM.. Reason: Removed identation with spaces with identation with tabulator.
howl is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
language patch dragsteur[BW] General questions 0 06-08-2009 06:28 PM
Installed songs not working after selected Eako Song and Course questions 3 03-13-2009 04:08 PM
SM4 crashed when i selected a theme xcandlexcorex Crash questions 2 07-31-2008 06:24 AM
When SM4 becomes Alpha/Beta, should it have a full Japanese language patch? Dark Coz General StepMania 3 06-13-2008 10:04 PM
Getting a lower grade on scorescreen than previous grade Bludjinni General questions 7 12-16-2006 07:36 PM


All times are GMT. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Thanks to

SourceForge.net Logo