UWP localize print dialog - printing

Using the "Printing" project from the "Windows-universal-samples-master" examples on GitHub... scenario 4 is showing:
displayedOptions.Add(Windows.Graphics.Printing.StandardPrintTaskOptions.CustomPageRanges);
printTask.Options.PageRangeOptions.AllowCurrentPage = true;
printTask.Options.PageRangeOptions.AllowAllPages = true;
printTask.Options.PageRangeOptions.AllowCustomSetOfPages = true;
My question is how do you localize these settings of the print dialog?
I did set my primary language to French in Control Panel but the print dialog still shows the options in English ("All pages", "Custom range", "Page range"...).

Setting the Preferred language to French was not sufficient, you need set the Windows display language as France as well.

Related

How to run an Applescript that will click and open all links on a web page?

I'm trying to write a script that will automatically open a webpage http://www.legislation.gov.uk/new/uksi and then click on all the links in the table "All New Legislation".
So far I've managed to get it to open the page but no luck with clicking.
Here's my script so far:
activate application "Safari"
open location "http://www.legislation.gov.uk/new/uksi"
to clickID()
do JavaScript "document.getElementById(id=per).click();" in document 1
end tell
The following example AppleScript code will open the targetURL in a new Safari window, wait for the page to finish loading, retrieve all URLs on the target page, search them for URLs pointing the various Statutory Instruments published today, and then open each one in a new tab of the same window the targetURL was opened.
set targetURL to "http://www.legislation.gov.uk/new/uksi"
set theseURLs to {}
set grepSearchPattern to ".*\\.uk/uksi/.*\\|.*\\.uk/ssi/.*\\|.*\\.uk/wsi/.*\\|.*\\.uk/nisi/.*"
set jsStatements to "var a = document.links; var x = ''; var i; for (i = 0; i < a.length; i++) { x = x + a[i].href + '|'; };"
tell application "Safari"
make new document with properties {URL:targetURL}
activate
end tell
tell application "System Events"
repeat until exists ¬
(buttons of UI elements of groups of toolbar 1 of window 1 of ¬
process "Safari" whose name = "Reload this page")
delay 1
end repeat
end tell
tell application "Safari"
set allURLs to (do JavaScript jsStatements in document 1)
end tell
try
set theseURLs to paragraphs of (do shell script "tr '|' '\\12' <<< " & ¬
allURLs's quoted form & " | grep " & grepSearchPattern's quoted form)
end try
if (length of theseURLs) is greater than 0 then
tell application "Safari" to tell front window
repeat with thisURL in theseURLs
set current tab to (make new tab with properties {URL:thisURL})
end repeat
set current tab to first tab
end tell
else
display dialog " Nothing published on this date." buttons {"OK"} ¬
default button 1 with title "All New Legislation" with icon note
end if
Hint: Mouse over and horizontal/vertical scroll to see full code.
Notes:
The do JavaScript1 command create a pipe delimited string of all URLs on the page of the targetURL.
The do shell script command takes the pipe delimited string of all URLs and replaces the pipe characters with newline characters, using tr, so grep can return the URLs that match the grepSearchPattern.
The grepSearchPattern variable currently only searches for Statutory Instruments, as I assume that is all that will show under All New Legislation on the page the targetURL opens to, because of /new/uksi in the targetURL, and what I've observed at that URL since you posted the question. If you also want links for other types of legislation, the grepSearchPattern variable can be adjusted to accommodate.
1 Using the do JavaScript command requires Allow JavaScript from Apple Events to be checked on the Safari > Develop menu, which is hidden by default and can be shown by checking [√] Show Develop menu in menu bar in: Safari > Preferences… > AdvancedIf you are not allowed to enable that setting, the URLs can be collected for processing in another manner, however it uses the lynx third party utility.
Opening the links without the use of the do JavaScript command:
The following example AppleScript code will use lynx to retrieve the URLs from the targetURL, search them for URLs pointing the various Statutory Instruments published today, and if some have been published will open the targetURL in a new Safari window, wait for the page to finish loading, and then open each one in a new tab of the same window the targetURL was opened.
set targetURL to "http://www.legislation.gov.uk/new/uksi"
set theseURLs to {}
set lynxCommand to "/usr/local/bin/lynx --dump -listonly -nonumbers -hiddenlinks=ignore"
set grepSearchPattern to ".*\\.uk/uksi/.*\\|.*\\.uk/ssi/.*\\|.*\\.uk/wsi/.*\\|.*\\.uk/nisi/.*"
try
set theseURLs to paragraphs of ¬
(do shell script lynxCommand & space & targetURL's quoted form & ¬
" | grep " & grepSearchPattern's quoted form)
end try
if (length of theseURLs) is greater than 0 then
tell application "Safari"
make new document with properties {URL:targetURL}
activate
end tell
tell application "System Events"
repeat until exists ¬
(buttons of UI elements of groups of toolbar 1 of window 1 of ¬
process "Safari" whose name = "Reload this page")
delay 1
end repeat
end tell
tell application "Safari" to tell front window
repeat with thisURL in theseURLs
set current tab to (make new tab with properties {URL:thisURL})
end repeat
set current tab to first tab
end tell
else
display dialog " Nothing published on this date." buttons {"OK"} ¬
default button 1 with title "All New Legislation" with icon note
end if
Hint: Mouse over and horizontal/vertical scroll to see full code.
Notes:
In the lynxCommand variable, change /usr/local/bin/lynx to the appropriate /path/to/lynx. lynx can be installed using Homebrew
The grepSearchPattern variable currently only searches for Statutory Instruments, as I assume that is all that will show under All New Legislation on the page the targetURL opens to, because of /new/uksi in the targetURL, and what I've observed at that URL since you posted the question. If you also want links for other types of legislation, the grepSearchPattern variable can be adjusted to accommodate.
Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors.

IOS xpages date picker return "This field is not a valid date" when submitting a document

I am using a simple page with 1 text field.
Display type = Date/time
Display format = Date only
Date style = default
It works on a browser on the pc but on an iPad it returns "This field is not a valid date"
I notice that when picking a date on the iPad the format is different.
On a browser it is "Apr 21, 2017"
On the iPad "21 apr. 2017"
What am I doing wrong?
regards,
Peter
I created a PMR for this and IBM came up with this workaround.
Why it happens since FP8 and not before is not mentioned.
On mobile there is a iOS picker, which allows you to select the date. An user cannot add an invalid date, so therefore client side validation is not technically required. You would allow the data to go to the server and check server validation there.
On web it is different, as in there is a date time picker and an edit box so user's can enter anything.
The client side validation is only checking that invalid data is not entered (not possible on mobile because of the native iOS/Android pickers
The server validation checks things like if it is expecting constraints such as date must be between last year & this year etc
So the suggested workaround is to can turn client side validation off for certain controls on mobile. And leave it one for web.
There is a snippet of code on the date time control which will check whether you are on mobile or web and set this to true or false based on that
<xp:this.disableClientSideValidation><![CDATA[#{javascript:
if(deviceBean.isMobile()){
return true;
}else if(deviceBean.isTablet()){
return true
}else{
return false;
}}]]></xp:this.disableClientSideValidation>
IBM Reports the fix wil be in release 9.0.1.FP9. IBM proposes another workaround. See below.You can create a custom theme in your app, with the following:
<theme extends="Bootstrap3_flat" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="platform:/plugin/com.ibm.designer.domino.stylekits/schema/stylekit.xsd" >
<control>
<name>InputField.DateTimePicker</name>
<property baseValue="com.ibm.xsp.DateTimeHelper">
<name>rendererType</name>
<value>com.ibm.xsp.theme.bootstrap.form.InputDateDetect</value>
</property>
<property>
<name>disableClientSideValidation</name>
<value>#{deviceBean.mobile || deviceBean.tablet}</value>
</property>
</control>
</theme>
Then in xsp.properties, choose the custom theme in the application theme dropdown Themes
help doc: https://www.ibm.com/support/knowledgecenter/SSVRGU_9.0.0/com.ibm.designer.domino.ui.doc/wpd_theme.html
The effect of this is to disable client side validation for date time picker controls on mobile devices only.

Localization Issue in IOS Swift to change langue on button Click

I have tried to follow the below link to achieve localization .
Tutorial
It seems not working ( only English text appears )
My requirement is to change the label/button texts etc. to be changed from English to Arabic language and vice-versa on a button click inside the App.
I have already have a translated Arabic strings available from the client so I dont have to use a translation ( import/export - xliff) . Created 2 string files for English and Arabic separately and calling it ViewDidload() event checking the User had opted for Arabic/English Version.
Please note that I'm trying load the languages dynamically when user clicks button inside my app . Not by changing the device language .
For ex:
Localizable.string ( en)
"Details" = "Details";
Localizable.string(ar)
"Details" = "التفاصيل " ;
retrieval:
btnDetail.setTitle(NSLocalizedString("Details", comment: "More Details"), forState: .Normal)
But its showing only english but not Arabic when I call in buttonclick event to change to Arabic.
Please help. I m new to IOS and Swift.

iOS 6 UIActivityViewController - how to present Share Action Sheet with local language?

How to change built-in labels such as "Mail", "Weibo", "Copy", "Cancel" on the popup sharing -panel into local language? Thanks!
"Add "Localized resources can be mixed" and set its value as "Yes" in Info.plist." Also solved my problem! Thank you!
My app has 1 language Russian, so it helps me:
In Info.plist
For example add key "Localization native development region" = "ru"(your locale)

Hindi characters not rendered properly in Android

I want to test localization in Indian language in Android.
Following is the file string.xml in values folder
<string name="app_name">नमस्ते</string>
<string name="text_a">परिक्षण</string>
I am using AndroidHindi.ttf font.
I want to display the particular text in hindi in adnroid , but while running I am getting unrendered text .
which particular library should I include to display it properly.
you must download your language font file(.ttf) and put in asset folder.
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Akshar.ttf");
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf);
tv.setText("Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's");
Source

Resources