Change default language for TFS 2018 - tfs

I have an installation of Team Foundation Server 2018. The problem is the web interface defaults to English (United States). I need to change this to English (Canada) as the default but this is not in the Language drop down.
The Windows Server is set to use English (Canada) so I need to know how to update TFS. The main reason I need this is that the US write their dates backwards and this causes all sort of issues with work tracking as people assume the date is the correct way around and we end up with tasks due on the 11th of January when they should be for the 1st of November.
I know one possible work around would be for everyone to set their language specifically to English (United States) and then change the default date pattern so the date is correct, but this is not satisfactory as it involves work on the part of hundreds of users.

The best way to solve this is to configure Windows to send the primary browser locale as 'en-CA', this can be done through an Active Directory Policy, with TFS configured to use "Browser" as locale it should default to the correct date format for that locale.
(See the locale switching to "Nederlands (Nederland)" which is my locale)
If users are using a different browser, they may have to configure that as well, for example, my Chrome configuration:
Alternatively, you can set the language for each users in the TFS Configuration Database for individual users. It can be overridden there in bulk.
THIS IS NOT SUPPORTED AND MAY LEAVE YOU IN A BROKEN STATE
update [Tfs_Configuration].[dbo].[tbl_RegistryItems]
set
[RegValue] = 'dd-MM-yyyy'
where
ParentPath LIKE '#\Users\%\UserPreferences\'
and ChildItem = 'DatePattern\'
insert into [Tfs_Configuration].[dbo].[tbl_RegistryItems]
(PartitionId, ParentPath, ChildItem, RegValue)
select
1 as PartitionId,
'#\Users\' + lower(convert(nvarchar(36), tbl_Identity.Id)) + '\UserPreferences\' as ParentPath,
'DatePattern\' as ChildItem,
'dd-MM-yyyy' as RegItem
from tbl_Identity
where
IsGroup = 0
and Domain = 'AzureAD'
and not exists
(
select 1 from [Tfs_Configuration].[dbo].[tbl_RegistryItems]
where ParentPath = '#\Users\' + lower(convert(nvarchar(36), tbl_Identity.Id)) + '\UserPreferences\'
and ChildItem = 'DatePattern\'
)

Sorry, the language settings in locale -> user profile do not include all language option such as English (Canada).
According to your description, you could simply change Date pattern under the preferred language which basically contains all the options,
For example, select d-MM-yy, then 1st of November should be 01/11/2018.

Related

Locale setting of importxml function in google sheet not working

I'm trying to extract prices from bookdepositary site in local currency. However, it always retrieves the USD prices no matter what I am trying.
A specific example is:
=IMPORTXML("https://www.bookdepository.com/1/9783836519885";"//span[#class='sale-price']";"bg-BG")
gives US$47.63 no matter that Google sheet settings are changed to Bulgarian and despite of the locale set to "bg-BG".
The same US$47.63 result is retrieved when I use another scrap method like:
=IMPORTXML("https://www.bookdepository.com/1/9783836519885";"//meta[#itemprop='price']/#content";"bg-BG")
The following does not retrieve any result (but this is a secondary problem I am investigating which will follow once I understand the locale problem):
=IMPORTXML("https://www.bookdepository.com/1/9783836519885";"/html/body/div[2]/div[6]/div[3]/div/div[1]/div[1]/div[3]/div/div[2]/div/div[3]/div/span[1]";"bg-BG")
What do you think - is there a workaround?
I don't think that can be done with importXML().
The function help page seems to be missing the locale parameter, but the formula editor inline help box tells the following:
locale: A language and region locale code to use when parsing the data. If unspecified, the document locale will be used.
The importXML() function only finds data that actually appears in the XML document. The endpoint you mention seems to adjust its content per the client's IP address, but in each response, it only has prices in one currency.
The locale parameter does not change the IP address the request is sent from. It gets sent from one of Google's servers, most of which are in the United States. When you set the locale parameter, the content may get parsed in a different way, but that will not magically make additional content appear in the page.
in this case, what you actually need is to fool google sheet to not default out on the "common path"
you need something like: https://www.4everproxy.com/ (but with Bulgarian support)
here is some example...
where:
and then the formula will be from:
=IMPORTXML("https://de.4everproxy.com/direct/aHR0cHM6Ly93d3cuYm9va2RlcG9zaXRvcnkuY29tLzEvOTc4MzgzNjUxOTg4NQ--","//span[#class='sale-price']")

How can set currency after price in hybris?

I want to show the prices as 45.99 Kč
It is showing as Kč 45.99.
I tried formatters.impex
INSERT_UPDATE PriceFormatter;owner(CountryConfiguration.code)[unique=true];patternPositives[lang=cs_CZ];patternNegatives[lang=cs_CZ];decimalSeparator[lang=cs_CZ];groupingSeparator[lang=cs_CZ];currencySymbol;
;CZ;#{groupingSeparator}##0{decimalSeparator}00 {currencySymbol};- #{groupingSeparator}##0{decimalSeparator}00 {currencySymbol};,;space;Kč;
I can't find PriceFormatter in version 2005.Can it be custom type which is developed by your team?
Currency position information coming from localization. You can check DefaultPriceDataFactory class. It is determine current locale with CommerceCommonI18NService and I18NService then determine format in createCurrencyFormat method.
I am not sure CZ currency format but you can check it in your/server NumberFormat localization. If your java localization not mach your need, you can change it.
Another way is editing price.tag file for frontend to change using price and currency instead of formattedPrice.

Capybara DayPickerInput selection?

Has anyone had any luck in figuring out how to use the react library https://react-day-picker.js.org/docs/input/
With Capybara/Selenium? Unfortunately it doesn't allow simply typing in the text such as MM/DD/YYYY like most date-pickers. This only allows mouse selection.
Or is specifically setting the value basically the only way to do so?
Without an example which shows the actual configuration of react-day-picker you're dealing with it's impossible to say exactly what you need to do, but the general rule is if you are testing the sites functionality then do what a user would need to do. In your case that may mean click on the forward/back month arrows until you get to the desired month, then click on the specific day element. Assuming the date you want to select is in the future (September 20, 2019) it would be something like
caption = find('.DayPicker-Caption')
until caption.has_text?('September 2019', wait: 0) do
current_month = caption.text
find('.DayPicker-NavButton--next').click
# wait for month to change
expect(caption).not_to have_text(current_month)
end
find('.DayPicker-Day', exact_text: '20').click
If you're not actually testing functionality (web scraping, etc) then you can use execute_script to call the react-day-picker JS API and set a specific date.

Grails: How to format date in language set in locale?

My multi-language Grails-based website has a switch for locale. I'd like to make sure date values are displayed in the locale set (and in the format currently being used in other outputs of scaffolding as the site is already available to the customer).
Here's an example code I'm using:
<g:formatDate date="${eventInstance?.date}"/>
The solution I came up with following this entry from the manual is:
<g:formatDate date="${eventInstance?.date}" formatName="default.date.format.short" />
and in my i18n/*.properties files settings for default.date.format.short (the global standard, default.date.format, was already set to another format).

How to choose the best matching localization language from list

My windows store application gets localized strings from database. Each string is stored with language code (en-US, en-CA, en-AU, etc.). How can I determine the best matching language for my application if my current system locale is en-US?
It looks like a NamedResource.Resolve(ResourceManager.Current.DefaultContext) could be a solution, but I cannot find the way to create a NamedResource.Candidates list from code.

Resources