Questions tagged [i18n]

Internationalization, also known as i18n, refers to the techniques and tools to make the software change its behavior based on the country or culture of the user running it. This is a matter not only of changing the language which the software presents (e.g. in its user interface), but of changing the date format, the orientation of the text, the numeric format, and other aspects of its behavior to reflect the culture.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
648 views

I wrote a header file to write German umlauts in a textfile properly

This function is about the fact that a std::wstring was used in another cpp file in order to be able to read strings with German umlauts from the console. Since it is difficult to get wstrings into a ...
Daniel's user avatar
  • 219
5 votes
1 answer
375 views

Converting IDN domains to Punycode in Perl

Description This script takes any domain input from STDIN and converts unicode domains into punycode. Features Any domains that throw an error get ignored. When fed any ASCII domains, they just pass ...
T145's user avatar
  • 3,087
3 votes
0 answers
100 views

Language switcher for a multilingual site

I have written some javascript code for a multilanguage site. The code works great but I feel like I have a lot of duplicate code. I was wondering if someone can explain how I can make this simpler or ...
Rebecca B's user avatar
1 vote
1 answer
138 views

Implement RTL functionality in a Material UI app

I've been tasked with adding RTL support to Material UI project. I've stripped non-essential code down to a simplified version of the UI/Theme module. My solution ...
torus_knot783's user avatar
2 votes
0 answers
23 views

Localization of multi style text element in Vue

After following up this question, I'm thinking if there's a better/shorter way to write this text element that has part with different style, while allowing localizations: ...
Nicke Manarin's user avatar
6 votes
3 answers
2k views

Function to extract float from different price patterns

I've got a project where I get product data and need to get the prices which come in, in different formats. Some examples would be: US$17, USD17.00, 17,00€, 17€, GBP17, Only 17,-€, 17.000,00€, 17,000....
Chris's user avatar
  • 161
3 votes
1 answer
102 views

Language switch based on parameters and session state

I use this to set language session for navigation. Someone said that this switch is too cumbersome. Why? Is there an easier way? ...
Ogum's user avatar
  • 133
1 vote
1 answer
1k views

Language switcher, consulting browser's localStorage

I'm using angular 6 and ngx-translate. This is my switch language function ...
Lynob's user avatar
  • 145
3 votes
1 answer
77 views

Using something other than form field's value in Vue

I have a form, I need to send untraslated values, but as well, I need to get translated ones from Vue to write them down in page. For now, I ended up creating a 'shadow' property and changing it via ...
Luca Reghellin's user avatar
5 votes
1 answer
232 views

Wrapper to translate text in wxPython widgets

I am writing a wrapper for all widgets that contain text that needs to be translated for wxPython and make them handle the initial translation and the change of language on their own using gettext. I ...
Michael K.'s user avatar
2 votes
3 answers
2k views

Lookup country codes with a JavaScript ES6 Map Object

In my application, a country code may be passed from the client as a URL query string or in a header. If there is no country in the URL or headers, then it will default to the United States. The ...
Aaron Goldsmith's user avatar
6 votes
1 answer
142 views

Multi-lang support for names of playing cards

Context: Coming from C# I am building a python 3.6 texas hold'em to get acquainted with different python features. I am currently buidling enums for card-colors and ...
Patrick Artner's user avatar
1 vote
0 answers
1k views

Retrieving localized Days of Week in PHP : setlocale VS IntlDateFormatter

I'm trying to find a good way to dynamically print a selection of localized days of week without resorting to an hard-coded array per language, leveraging locale mechanisms instead. Up until now, I'...
Jonathan Bérubé's user avatar
8 votes
2 answers
214 views

Node JS routing system

I am doing a website for an association and I have never done the server side before. Here I made a very simple routing system: ...
Shashimee's user avatar
  • 131
1 vote
1 answer
133 views

Javascript browser charset rendering detection

I am attempting to polyfill the broken character encoding system in javascript. For example, characters such as 😒, have a length of 2 and are treated as 2 separate ...
3.1415926535897932384626433833's user avatar
2 votes
2 answers
1k views

RTL management HTML & CSS

I've been working around a solution to easily manage LTR and RTL on the same interface. The different solutions I knew at first: Override CSS according to direction. Use a program to transform your ...
Elfayer's user avatar
  • 303
11 votes
1 answer
211 views

VS 2015 std::char_traits<char16_t> operations

At my workplace, we changed string type (which holds internationalized characters) for from std::wstring to std::u16string after ...
Recker's user avatar
  • 213
0 votes
2 answers
2k views

Multilanguage Support in Apache Cordova [closed]

I currently have a languages.js set up as such: ...
Jaken's user avatar
  • 177
4 votes
2 answers
569 views

PHP function to convert a Portuguese word from plural to singular

I know, this sounds really difficult, but it is really easy. I needed to convert a single Portuguese word in the plural into singular. I know there's a right name for that, but it is escaping me. ...
Ismael Miguel's user avatar
8 votes
4 answers
6k views

Convert an amount to Indian Notation

I need to convert an amount to an Indian currency format: ...
User_Targaryen's user avatar
0 votes
2 answers
2k views

PHP script to generate hreflang tags

I'm currently working on a website which provides content to users based on their region. As a result the website has subdirectories for the appropriate regions. For example, a pricing page would look ...
Javacadabra's user avatar
2 votes
2 answers
86 views

Locale language reducer

I am learning redux by doing a small project. Everything is working fine, but I need to know how I can refactor such code. For this situation, it might be good to use ...
Serenity's user avatar
  • 211
3 votes
1 answer
152 views

Dual-language beginner math solver program in C++

I've written a program that solves questions of: Addition Finding the hypotenuse of a triangle Checking if the triangle has a right-angle or not I've also written it to be viewed in English or ...
Exercise To The Reader's user avatar
4 votes
3 answers
171 views

Describing a date interval as text

...
Tn Hn's user avatar
  • 43
0 votes
4 answers
219 views

Multilingual command handler using inheritance

My problem is that you have a lot of ifconditions to be checked and inside that if condition you have multiple lines of code. I ...
Akila Hettiarachchi's user avatar
4 votes
1 answer
354 views

Using a MutationObserver to reformat numbers in the user's locale

I mostly just want to make sure I've understood the specs correctly with this code, but here goes: ...
Niet the Dark Absol's user avatar
1 vote
1 answer
27 views

Creating and sending two kinds of notification messages

I wish to get rid of using switch case with statuses twice in my code. But create_message function will be bigger in the future, so must stay and I don't want to ...
user avatar
14 votes
3 answers
197 views

Fighting f̶i̶r̶e̶ regex with f̶i̶r̶e̶ regex

So someone requested a Regex Builder / Assistant for Rubberduck and since my CS class had been covering the topic only recently I was thinking to myself: "This sounds interesting, you should do ...
Vogel612's user avatar
  • 25.2k
3 votes
1 answer
151 views

Convert accented character to user name

I am using the below function for converting the accented character to a standard ASCII user name. ...
Hitesh's user avatar
  • 131
6 votes
1 answer
701 views

Integer to roman number converter

This is (yet another) integer to Roman numeral converter. To give it a slightly interesting twist, I've implemented this as a num_put facet of a C++ locale, so by ...
Jerry Coffin's user avatar
  • 33.5k
1 vote
0 answers
1k views

MVC application internationalization using a database provider and dependency injection

Following Nadeem Afana's article about how to include internationalization into an MVC application, I have introduced i18n into one of my MVC applications. These ...
Alexei's user avatar
  • 1,796
5 votes
1 answer
1k views

Multilanguage class that detects and sets language

I have been learning object oriented programming for quite a while. I understand many concepts about it but I quickly realized that I made a big mistake just reading theory and not doing any actual ...
Erasus's user avatar
  • 240
1 vote
1 answer
48 views

Displaying available destinations using Angular.JS

I wonder to know if there is any bad smell on my practice for i18n on Angular. I put the I18n translating function on Angular controller (because I don't know how to put it on HTML template file) And ...
poc's user avatar
  • 605
13 votes
2 answers
157 views

"Drone Racer" now shipping in your local area

This question is a follow-up of this one; where I present a software to plan and manage drone races. I might come with a new question about the SQL part in a few days as well. The code can still be ...
301_Moved_Permanently's user avatar
4 votes
3 answers
156 views

Setting locale based on preferences with fallbacks

Consider the following code. Are the multiple assignments to the loc variable a code smell? If so, how can I refactor this? ...
Saim's user avatar
  • 173
14 votes
2 answers
264 views

Learning by translating - Follow the Rubberduck - Part 2: Beta

This project is my learning place for a few things: MVP (model view presenter) XML (parsing, editing and leveraging) deeper swing functionality Concerning the XML part I have already recieved a ...
Vogel612's user avatar
  • 25.2k
15 votes
2 answers
274 views

One, two, three, … Un, deux, trois, …, maxBound::Int

I wrote a numbers-to-words converter for English, then tried to adapt the code to work for French. I'm wondering mainly whether any simplifications are possible. In English English is relatively ...
200_success's user avatar
16 votes
2 answers
18k views

Convert Persian digits to English numbers

I use the following code to convert ۱۲۳۴۵ to ‍12345, effectively transliterating the persian numbers into latin numbers: ...
Milad Khajavi's user avatar
5 votes
2 answers
1k views

Python script to create Android/iOS strings from a .csv

My script takes a CSV file of strings and then creates an XML file for Android and a .strings file to be used for iOS. It separates each locale meaning that a file will be created for each language. ...
stepwise_refinement's user avatar
12 votes
1 answer
422 views

Rust language tag implementation

language-tags is my first crate, it is hosted on GitHub and I uploaded it to Crates.io. It parses language tags like en-US into useful parts, like language and ...
Pyfisch's user avatar
  • 661
19 votes
3 answers
292 views

Translating the Rubberduck - Übersetzen der Gummiente - Part 1: Modelling

So I have committed to making a German translation for the guys over at Rubberduck, which is localized via .resx files. Now these files are basically XML-Files with a certain, rather simple document ...
Vogel612's user avatar
  • 25.2k
3 votes
1 answer
2k views

Formatting phone number without knowing locale

I am trying to format supplied phone numbers for a web application. Users in general will be supplying US-based phone numbers, but it is possible for some users to input a phone number from another ...
riddle_me_this's user avatar
4 votes
1 answer
52 views

Selecting internationalization preferences

I have a query below using CTE. I am wondering if there are some approach other than this. So I am collecting some advise to refactor it. Or does the query look good even though I am using this ...
user62376's user avatar
0 votes
2 answers
214 views

Factory Girl in Rails

I have a FactoryGirl page that generates same data but in two different languages. The variable names are the same. How do I write it in the smartest way possible without having to write a huge bunch ...
Kingsley Simon's user avatar
3 votes
1 answer
355 views

Test if a string is a number

In need for testing if a string is a number which could be a double or integer, I wrote a simple skeleton, which parses a string like this: ...
oz123's user avatar
  • 497
2 votes
2 answers
98 views

Transliterating Tatar To Cyrillic

Input : <h2>{translate} Dear Atteck {/translate} <br/></h2>{translate}Please complete registration</h5> {/translate} Output : ...
ahmettek's user avatar
9 votes
2 answers
4k views

Using I18n in capybara feature specs

Here I am trying to avoid hardcoding in flash messages by using I18n. Also, I have tried to use a CSS selector for submitting the form to make the tests less brittle (I don't really care that much ...
papirtiger's user avatar
2 votes
1 answer
67 views

JavaScript library for cookie information

I've always struggled to write JavaScript code that I thought of as great and "correct" code. And I've struggled to find good information on how to do it. Recently I was given a task at work to write ...
Stromgren's user avatar
  • 165
7 votes
3 answers
353 views

Parsing dates from an OCR application

I wrote this code to parse dates from the output of the OCR, which means that the obtained date can be literally anything, so I put some restrictions in place: Date is the the format of: ...
skiwi's user avatar
  • 10.7k
1 vote
1 answer
102 views

Two implementations of website internationalization

I have attempted to create an internationalization system for my PHP framework that I'm working on. For the purpose I decided I will be using MySQL to store languages and translations. Respectively I ...
php_nub_qq's user avatar