localization

Localization when using time.Format

≯℡__Kan透↙ 提交于 2020-02-13 09:54:42
问题 In the time package, when formatting a time.Time variable, the output will use the English names for weeks and months as defined in unexported []string slices. How to localize the string, using a different language (hopefully still using Format() )? Example: fmt.Println(time.Now().Format("Mon 2 January 2006")) Output: Tue 28 January 2014 Desired output: Tis 28 Januari 2014 Playground 回答1: As you can see in time package sourcecode that values are hardcoded in source. So, basically, Go doesn't

Localization when using time.Format

冷暖自知 提交于 2020-02-13 09:54:01
问题 In the time package, when formatting a time.Time variable, the output will use the English names for weeks and months as defined in unexported []string slices. How to localize the string, using a different language (hopefully still using Format() )? Example: fmt.Println(time.Now().Format("Mon 2 January 2006")) Output: Tue 28 January 2014 Desired output: Tis 28 Januari 2014 Playground 回答1: As you can see in time package sourcecode that values are hardcoded in source. So, basically, Go doesn't

Using ISO 639-2 or ISO 639-3 as authoritative languages list?

本秂侑毒 提交于 2020-02-07 06:29:45
问题 (changed title so as not to confuse future readers) Is this an authoritative list of languages I can use for my application? From: http://en.wikipedia.org/wiki/ISO_639-1 --> http://www.infoterm.info/standardization/iso_639_1_2002.php ISO Language Codes ISO 639-1:2002 Codes for the representation of names of languages -- Part 1: Alpha-2 code Infoterm has been designated the Registration Authority (ISO 639-1/RA) for the language alpha-2 language code contained in ISO 639-1:2002 "Codes for the

Save/open dialog localization in Qt

你。 提交于 2020-02-03 13:34:01
问题 I try to set localization for standard save or open dialogs, but everything except window caption remains English. I use Qt 4.7.4 and KDE of the same version. The following example application: #include <QApplication> #include <QFileDialog> #include <QTranslator> #include <QLibraryInfo> #include <QDebug> int main(int argc, char **argv) { QApplication app(argc,argv); QTranslator qTranslator; QString transPath=QLibraryInfo::location(QLibraryInfo::TranslationsPath); qTranslator.load("qt_ru"

How to get the preferred language of a user before building a widget in Flutter?

╄→гoц情女王★ 提交于 2020-02-03 01:51:08
问题 I'd like to know what is the preferred language of the user (on Android that's something that the user defines in the Android's settings). I'd like to get this value. For example "fr", "en", "ja", or maybe "fr-CA", "en-US", "ja-JP". I just want to get the user preferred language to build a small widget within the app in the language the user prefers. This is something that should be very simple but I couldn't find a way to do this. For example, on Android, in Java, you can do Locale

iOS - Emphasise with bold strings in Localizable.strings

白昼怎懂夜的黑 提交于 2020-01-30 06:25:54
问题 Is there a way bold some words inside the Localizable file like so? "Pending network connection" = "<b>Pending</b> network connection"; I have this string inside and i want to emphasis only certen words: "camSave" = "To complete onboarding:\n1. Tap Save and disconnect to disconnect from the camera.\n2. Connect to the internet.\n3. Log in to Cloud."; Btw i want to use it inside alert 回答1: You can actually use HTML tags with NSAttributedString . This is what I used: static func

Localization for Canada defaults to UK; should default to US

一个人想着一个人 提交于 2020-01-29 23:42:11
问题 I'm working on an application that has localized strings for the UK, specified in res/values-en-rGB/strings.xml . My default string implementations, for the US, are in res/values/strings.xml . Now, I'm adding additional localizations for Canada in res/values-en-rCA/strings.xml . I would like the application to behave as follows: If a user's device is localized to Canada (or their language is set to English(Canada) or French(Canada) ), check if we have a string in en-rCA , and if not, fallback

Localization for Canada defaults to UK; should default to US

一个人想着一个人 提交于 2020-01-29 23:39:06
问题 I'm working on an application that has localized strings for the UK, specified in res/values-en-rGB/strings.xml . My default string implementations, for the US, are in res/values/strings.xml . Now, I'm adding additional localizations for Canada in res/values-en-rCA/strings.xml . I would like the application to behave as follows: If a user's device is localized to Canada (or their language is set to English(Canada) or French(Canada) ), check if we have a string in en-rCA , and if not, fallback

date / time conversion from user's local time to UTC on website

天大地大妈咪最大 提交于 2020-01-29 13:20:07
问题 I'm currently adding an out of office like system to a website, where users will be able to mark their out of office dates and times such that they can provide another users's information to use as a backup while they are out. The problem I have, is converting the users's local time to UTC. I've seen other posts that address this issue by supplying UTC to the user, and having the client (js) convert the time to and from local time. I do, however, have access to a propriety system I can use to

date / time conversion from user's local time to UTC on website

删除回忆录丶 提交于 2020-01-29 13:18:46
问题 I'm currently adding an out of office like system to a website, where users will be able to mark their out of office dates and times such that they can provide another users's information to use as a backup while they are out. The problem I have, is converting the users's local time to UTC. I've seen other posts that address this issue by supplying UTC to the user, and having the client (js) convert the time to and from local time. I do, however, have access to a propriety system I can use to