mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	[i18n] start multilang support for webconsole
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
		
							parent
							
								
									59b471b9a2
								
							
						
					
					
						commit
						0e68fe4a57
					
				
					 6 changed files with 140 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -47,10 +47,10 @@ namespace fs {
 | 
			
		|||
			return;
 | 
			
		||||
		}
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
		char localAppData[MAX_PATH];
 | 
			
		||||
		wchar_t localAppData[MAX_PATH];
 | 
			
		||||
 | 
			
		||||
		// check executable directory first
 | 
			
		||||
		if(!GetModuleFileName(NULL, localAppData, MAX_PATH))
 | 
			
		||||
		if(!GetModuleFileNameW(NULL, localAppData, MAX_PATH))
 | 
			
		||||
		{
 | 
			
		||||
#ifdef WIN32_APP
 | 
			
		||||
			MessageBox(NULL, TEXT("Unable to get application path!"), TEXT("I2Pd: error"), MB_ICONERROR | MB_OK);
 | 
			
		||||
| 
						 | 
				
			
			@ -61,14 +61,15 @@ namespace fs {
 | 
			
		|||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			auto execPath = boost::filesystem::path(localAppData).parent_path();
 | 
			
		||||
			auto execPath = boost::filesystem::wpath(localAppData).parent_path();
 | 
			
		||||
 | 
			
		||||
			// if config file exists in .exe's folder use it
 | 
			
		||||
			if(boost::filesystem::exists(execPath/"i2pd.conf")) // TODO: magic string
 | 
			
		||||
				dataDir = execPath.string ();
 | 
			
		||||
			else // otherwise %appdata%
 | 
			
		||||
			{
 | 
			
		||||
				if(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, localAppData) != S_OK)
 | 
			
		||||
				dataDir = execPath.string ();
 | 
			
		||||
			} else // otherwise %appdata%
 | 
			
		||||
			{
 | 
			
		||||
				if(SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, localAppData) != S_OK)
 | 
			
		||||
				{
 | 
			
		||||
#ifdef WIN32_APP
 | 
			
		||||
					MessageBox(NULL, TEXT("Unable to get AppData path!"), TEXT("I2Pd: error"), MB_ICONERROR | MB_OK);
 | 
			
		||||
| 
						 | 
				
			
			@ -78,7 +79,9 @@ namespace fs {
 | 
			
		|||
					exit(1);
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
					dataDir = std::string(localAppData) + "\\" + appName;
 | 
			
		||||
				{
 | 
			
		||||
					dataDir = boost::filesystem::wpath(localAppData).string() + "\\" + appName;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue