Merge lp:~victored/scratch/init-gettext into lp:~elementary-apps/scratch/scratch

Proposed by Victor Martinez
Status: Merged
Approved by: Mario Guerriero
Approved revision: 1042
Merge reported by: Mario Guerriero
Merged at revision: not available
Proposed branch: lp:~victored/scratch/init-gettext
Merge into: lp:~elementary-apps/scratch/scratch
Diff against target: 28 lines (+7/-0)
2 files modified
src/Scratch.vala (+6/-0)
src/config.vala.cmake (+1/-0)
To merge this branch: bzr merge lp:~victored/scratch/init-gettext
Reviewer Review Type Date Requested Status
Mario Guerriero (community) Approve
Review via email: mp+163109@code.launchpad.net

Description of the change

Init Gettext so that Scratch can use its translations.

To post a comment you must log in.
Revision history for this message
Mario Guerriero (mefrio-g) wrote :

Thank you very much for the fix but next time don't forget to make your merge request a bit more visible assigning your branch to the relative bug :)

review: Approve
Revision history for this message
Victor Martinez (victored) wrote :

Hey Mario, sorry about that. I was in a hurry when I submitted the proposal :P

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Scratch.vala'
2--- src/Scratch.vala 2013-05-02 20:27:52 +0000
3+++ src/Scratch.vala 2013-05-09 08:55:31 +0000
4@@ -72,6 +72,12 @@
5 }
6
7 public ScratchApp () {
8+ // Init internationalization support
9+ Intl.setlocale (LocaleCategory.ALL, "");
10+ string langpack_dir = Path.build_filename (Constants.INSTALL_PREFIX, "share", "locale");
11+ Intl.bindtextdomain (Constants.GETTEXT_PACKAGE, langpack_dir);
12+ Intl.bind_textdomain_codeset (Constants.GETTEXT_PACKAGE, "UTF-8");
13+ Intl.textdomain (Constants.GETTEXT_PACKAGE);
14
15 Logger.initialize ("Scratch");
16 Logger.DisplayLevel = LogLevel.DEBUG;
17
18=== modified file 'src/config.vala.cmake'
19--- src/config.vala.cmake 2012-11-24 13:46:56 +0000
20+++ src/config.vala.cmake 2013-05-09 08:55:31 +0000
21@@ -7,6 +7,7 @@
22 public const string VERSION = "@VERSION@";
23 public const string VERSION_INFO = "@VERSION_INFO@";
24 public const string PLUGINDIR = "@PLUGINDIR@";
25+ public const string INSTALL_PREFIX = "@CMAKE_INSTALL_PREFIX@";
26
27 /* Translatable launcher (.desktop) strings to be added to */
28 /* template (.pot) file. These strings should reflect any */

Subscribers

People subscribed via source and target branches