-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locales init #563
base: master
Are you sure you want to change the base?
locales init #563
Conversation
2 issues with this PR is the 2 spaces instead of tabs and that this will not compile on windows |
|
@nadenislamarre There is an error because EDIT: adding the proper includes/libs makes the compilation succeed, so it probably just needs an adjustment to the |
In general not. I raised this question a while ago since I felt it is getting more and more important as contributions are gaining momentum (and for several other obvious reasons). |
I don't think there's anything set in stone. The default setting, inherited from the original ES code is tabs, each of them 4-spaces wide, I believe. |
6a2324b
to
95ee8b9
Compare
Signed-off-by: Nicolas Adenis-Lamarre <[email protected]>
95ee8b9
to
0704a4b
Compare
updated. |
Signed-off-by: Nicolas Adenis-Lamarre <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running make, locale/emulationstation.pot
and any language specific po files are being updated. Ideally this should only happen if there are no new messages.
Also currently as part of that regeneration, the order of the messages is being changed. I was able to prevent this by adding the -j option. This resulted in only the POT-Creation-Date entry being updated. Not sure if that is the best approach. But, as I said above, it would be preferred if these files only updated when there are new messages.
Also, for now can we remove the locale/lang
directory? We are discussing how we want to handle accepting translations, but for now we don't want to get a bunch PRs here to add various translations.
The thought is that for now we can at least include support for localization making it easier for anyone downstream to implement.
@@ -196,6 +197,28 @@ bool verifyHomeFolderExists() | |||
return true; | |||
} | |||
|
|||
void locales_init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use tabs vs 2 spaces
else | ||
ss << gameCount << " GAMES AVAILABLE"; | ||
else { | ||
snprintf(strbuf, 256, ngettext("%i GAME AVAILABLE", "%i GAMES AVAILABLE", gameCount), gameCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use tabs vs 2 spaces
|
||
#ifndef HAVE_GETTEXT | ||
char* ngettext(char* msgid, char* msgid_plural, unsigned long int n) { | ||
if(n != 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use tabs vs 2 spaces
#define _LOCALE_H_ | ||
|
||
#ifdef HAVE_GETTEXT | ||
#include <libintl.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use tabs vs 2 spaces
message (STATUS "Native language support enabled.") | ||
add_definitions(-DHAVE_GETTEXT) | ||
add_subdirectory (locale) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add an else
message indicating 'Native language support disabled'?
find_program (MSGFMT_EXECUTABLE msgfmt) | ||
find_program (MSGMERGE_EXECUTABLE msgmerge) | ||
find_program (XGETTEXT_EXECUTABLE xgettext) | ||
if(MSGFMT_EXECUTABLE AND MSGMERGE_EXECUTABLE AND XGETTEXT_EXECUTABLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add an option to disable even if all programs are available?
|
||
#define LOCALEDIR INSTALLATION_PREFIX_DIR "/share/locale" | ||
// local dir ; uncomment if you want to use locally compiled .mo files instead of .mo from the installation dir (present only after make install) | ||
//#define LOCALEDIR "./locale/lang" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RetroPie doesn't rely on make install
for installation. Can we make ./locale/lang
the enabled option?
Hi,
i'm from the batocera.linux project.
we have migrated to es-retropie for our system, because it is really the best es fork.
by doing this, we would like to become retropie-es contributors.
i've done a first pr here to include gettext into retropie-es.
it is minimal, but the aim is first to validate the process, the rules, and then, i'll add all the strings to translate.
Signed-off-by: Nicolas Adenis-Lamarre [email protected]