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
6
votes
3answers
249 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....
3
votes
1answer
85 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? ...
0
votes
0answers
20 views

Angular service that configures translations based on current business case

I have a simple Angular Service that pre-configures translations for the ngx-translate library based on the currently logged in business case. I'm not sure if my switch case statement within the if/...
1
vote
1answer
86 views

Language switcher, consulting browser's localStorage

I'm using angular 6 and ngx-translate. This is my switch language function ...
3
votes
1answer
68 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 ...
5
votes
1answer
187 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 ...
3
votes
3answers
234 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 ...
1
vote
0answers
287 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'...
8
votes
2answers
189 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: ...
1
vote
1answer
57 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 ...
2
votes
2answers
352 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 ...
11
votes
1answer
164 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 ...
0
votes
2answers
1k views

Multilanguage Support in Apache Cordova [closed]

I currently have a languages.js set up as such: ...
4
votes
2answers
346 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. ...
1
vote
0answers
64 views

Implementing internationalization functionality for online English lessons

My website purpose is to sell online English lessons to people in Europe. It is crucial that my site is multilingual. Overview I am using HMVC modules to organize my site and my website has four ...
8
votes
4answers
2k views

Convert an amount to Indian Notation

I need to convert an amount to an Indian currency format: ...
0
votes
2answers
645 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 ...
2
votes
2answers
75 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 ...
3
votes
1answer
138 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 ...
4
votes
3answers
163 views

Describing a date interval as text

...
0
votes
4answers
189 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 ...
3
votes
1answer
195 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: ...
1
vote
1answer
22 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 ...
14
votes
3answers
175 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 this". ...
3
votes
1answer
84 views

Convert accented character to user name

I am using the below function for converting the accented character to a standard ASCII user name. ...
6
votes
1answer
566 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 ...
1
vote
0answers
993 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 ...
5
votes
1answer
483 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 ...
1
vote
1answer
43 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 ...
1
vote
0answers
53 views

PHP class's errors in different languages

I have a data validation class, which I would like to return errors in many languages. I'm not writing the whole class, just the needed parts as my question only refers to that. ...
11
votes
2answers
127 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 ...
4
votes
3answers
143 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? ...
14
votes
2answers
240 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 ...
15
votes
2answers
230 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 ...
15
votes
2answers
10k views

Convert Persian digits to English numbers

I use the following code to convert ۱۲۳۴۵ to ‍12345, effectively transliterating the persian numbers into latin numbers: ...
4
votes
2answers
945 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. ...
10
votes
1answer
315 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 ...
19
votes
3answers
256 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 ...
3
votes
1answer
1k 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 ...
4
votes
1answer
50 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 ...
0
votes
2answers
203 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 ...
3
votes
1answer
110 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: ...
2
votes
2answers
87 views

Transliterating Tatar To Cyrillic

Input : <h2>{translate} Dear Atteck {/translate} <br/></h2>{translate}Please complete registration</h5> {/translate} Output : ...
8
votes
2answers
3k 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 ...
2
votes
1answer
59 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 ...
7
votes
3answers
231 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: ...
1
vote
1answer
98 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 ...
3
votes
2answers
121 views

Create nice url with diactrics removal

Please review my class. It uses iconv() (it's probably not the best solution however I haven't found any better alternative to change unknown characters). ...
5
votes
1answer
630 views

Program to find dollar words

A dollar word is a word for which the sum of the values of the letters adds up to 100 ($1.00). "a" has a value of 1 and "z" has a value of 26. Special characters such as apostrophes are ignored. ...
3
votes
2answers
1k views

Convert international datestring to ISO-format

The function below takes a datestring in the form d-mmm-yyyy and converts it to ISO date format (yyyy-mm-dd). Delimiters may be hyphen, space or /, and Dutch or ...