Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Fixed a bug where Brackets would not save user settings in the proper…
Browse files Browse the repository at this point in the history
… location. Added the .pak files to the list of files to be copied to output directory during build. Implemented ClientApp::GetCurrentLanguage(), this may not be the final version, input from the Brackets team is required on this.
  • Loading branch information
radorodopski committed Nov 10, 2012
1 parent 9e28fe7 commit a25ef54
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ tools
*.wixpdb
*.wixobj
bracketsharvestmanager.wxs
fr-fr.mst
fr-fr.mst

appshell_extensions_js.o
Makefile
appshell.Makefile
Brackets.target.mk
libcef_dll_wrapper.target.mk
6 changes: 2 additions & 4 deletions appshell/cefclient_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ std::string AppGetRunningDirectory() {
}

CefString AppGetCachePath() {
std::string cachePath = "file://"; //To avoid Unix paths being interpreted as http:// URLs
cachePath.append(ClientApp::AppGetSupportDirectory());
cachePath.append("/cef_data");
std::string cachePath = std::string(ClientApp::AppGetSupportDirectory()) + "/cef_data";

return CefString(cachePath);
}
Expand Down Expand Up @@ -202,4 +200,4 @@ int main(int argc, char* argv[]) {
CefShutdown();

return 0;
}
}
11 changes: 9 additions & 2 deletions appshell/client_app_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ extern char _binary_appshell_appshell_extensions_js_start;
CefString ClientApp::GetCurrentLanguage()
{
//TODO proper locale in GTK
printf("in GetCurrentLanguage\n");
return CefString("en");
printf("in GetCurrentLanguage: ");
const char* locconst = pango_language_to_string( gtk_get_default_language() );
//printf( "%s\n", locconst ); // for me it prints "en-us", so I have to strip everything after the "-"
char loc[10] = {0};
strncpy(loc, locconst, 9);
for(int i=0; i<8; i++)
if ( (loc[i] == '-') || (loc[i] == '_') ) { loc[i] = 0; break; }
printf( "%s\n", loc ); // here it prints just "en"
return CefString(loc);
}

std::string ClientApp::GetExtensionJSSource()
Expand Down
3 changes: 3 additions & 0 deletions appshell_paths.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@
'appshell_bundle_resources_linux': [
'$(BUILDTYPE)/locales',
'appshell/res/brackets.ico',
'$(BUILDTYPE)/cef.pak',
'$(BUILDTYPE)/cef_resources.pak',
'$(BUILDTYPE)/devtools_resources.pak',
],
'appshell_bundle_libraries_linux': [
'$(BUILDTYPE)/lib.target/libcef.so',
Expand Down

0 comments on commit a25ef54

Please sign in to comment.