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

Commit a25ef54

Browse files
committed
Fixed a bug where Brackets would not save user settings in the proper 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.
1 parent 9e28fe7 commit a25ef54

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,10 @@ tools
3535
*.wixpdb
3636
*.wixobj
3737
bracketsharvestmanager.wxs
38-
fr-fr.mst
38+
fr-fr.mst
39+
40+
appshell_extensions_js.o
41+
Makefile
42+
appshell.Makefile
43+
Brackets.target.mk
44+
libcef_dll_wrapper.target.mk

appshell/cefclient_gtk.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ std::string AppGetRunningDirectory() {
9292
}
9393

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

9997
return CefString(cachePath);
10098
}
@@ -202,4 +200,4 @@ int main(int argc, char* argv[]) {
202200
CefShutdown();
203201

204202
return 0;
205-
}
203+
}

appshell/client_app_gtk.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ extern char _binary_appshell_appshell_extensions_js_start;
3838
CefString ClientApp::GetCurrentLanguage()
3939
{
4040
//TODO proper locale in GTK
41-
printf("in GetCurrentLanguage\n");
42-
return CefString("en");
41+
printf("in GetCurrentLanguage: ");
42+
const char* locconst = pango_language_to_string( gtk_get_default_language() );
43+
//printf( "%s\n", locconst ); // for me it prints "en-us", so I have to strip everything after the "-"
44+
char loc[10] = {0};
45+
strncpy(loc, locconst, 9);
46+
for(int i=0; i<8; i++)
47+
if ( (loc[i] == '-') || (loc[i] == '_') ) { loc[i] = 0; break; }
48+
printf( "%s\n", loc ); // here it prints just "en"
49+
return CefString(loc);
4350
}
4451

4552
std::string ClientApp::GetExtensionJSSource()

appshell_paths.gypi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@
156156
'appshell_bundle_resources_linux': [
157157
'$(BUILDTYPE)/locales',
158158
'appshell/res/brackets.ico',
159+
'$(BUILDTYPE)/cef.pak',
160+
'$(BUILDTYPE)/cef_resources.pak',
161+
'$(BUILDTYPE)/devtools_resources.pak',
159162
],
160163
'appshell_bundle_libraries_linux': [
161164
'$(BUILDTYPE)/lib.target/libcef.so',

0 commit comments

Comments
 (0)