Search results for

“translate scheme”

6,670 results found

Post

Replies

Boosts

Views

Activity

Reply to Apple Translate App URL Scheme
Hi @ryrous, thanks for your interest in integrating with the Translate app. While I'm not sure about a URL scheme to launch the app, if you're hoping to provide translation functionality in your app you have a few options: Allow users to use standard text selection in your app. Then they can select text, choose Translate and see a translation within your app. Adopt the .translationPresentation() API to programmatically invoke the translation UI described in #1. You can add a Translate button that triggers this and shows the UI to the user. There's even an option in that UI to Open in Translate if the user chooses to do so. Have more control over translating text and displaying it within your app by adopting .translationTask and using TranslationSession APIs. This allows you to use the same translation engine as the Translate app from within your app, and display results however you'd like. For more information s
Topic: App & System Services SubTopic: General Tags:
Jul ’24
String Catalog Symbols: No Reference-Language Fallback for Partially Translated Locales
I'm having troubles converting my string catalog to symbols because for partly translated languages there is no fallback to the reference language. Let me give you an example. Example Assume an app that supports two languages: English and Japanese. The app is very simple and has only two strings, using symbols in a String Catalog: Key: .helloWorld → “Hello World!” Key: .info → “Information” Case 1: No Japanese translations If I launch the app in Japanese and neither string is translated, English is used as a fallback. The UI shows: “Hello World!” “Information” This is exactly what I would expect. Case 2: Only one string translated Now assume I translate only one string into Japanese: .helloWorld → “こんにちは世界” When I launch the app in Japanese now: .helloWorld correctly shows “こんにちは世界” .info shows info, not “Information” So instead of falling back to English, the key is displayed. This issue does not pop up when I don't use symbols. Because then, my SwiftUI Text eleme
1
0
123
Feb ’26
Translating swift to objective C "for in loop" NSString (I think) in NSDictionary
I'm currently stuck translating the code below for my apps database in firebase:Swift :var databaseRef = FIRDatabase.database().reference() var userDict = NSDictionary?() var userNamesArray = [String]() var userImagesArray = [String]() override func viewDidLoad() { super.viewDidLoad() self.databaseRef.child(@users).observeEventType(.Value, withBlock : { (snapshot in self.userDict = snapshot.value as? NSDictionary for(userId,details) in self.userDict!{ let img = details.objectForKey(@profile_pic_small as! String let name = details.objectForKey(@Name as! String let firstName = name.componentsSeperatedByString( )[0] self.userImagesArray.append(img) self.userNamesArray.append(firstName) self.collectionView?.reloadData() } })The code below is my attempt at translating but i'm definetly missing something:- (void)viewDidLoad { [super viewDidLoad]; _userNamesArray = [NSMutableArray new]; _userImagesArray = [NSMutableArray new]; self.databaseRef = [[FIRDatabase database] reference]; [[_databaseRef ch
0
0
584
Sep ’16
Reply to MyApp is calling TIS/TSM in non-main thread environment
I expect that message is coming from the Main Thread Checker: https://developer.apple.com/documentation/code_diagnostics/main_thread_checkerTIS = Text Input SourcesTSM = Text Services ManagerYou're doing something like trying to translate key events to characters on a background thread.There's a setting in the Scheme editor to make your app pause when it hits such a problem, so you can see the stack trace.
Jun ’18
Reply to localization works in preview but not in simulator or device
Yes, strings traslations work with .strings / NSLocalizedStringTable. Actually, I need to correct my self. Both nibs and strings translations work technically. The issue is that for the framework it uses the same translations regardless of what language/region I set on the scheme. It seems that it selects whichever is last alphabetically in the directory. I added several languages to test it, and it would always show whichever wast last. Initially I thought it would select whichever was added last, but I tested adding Ukraine before adding French, and still showed Ukraine. The same behavior happens with string (.strings) translations. I checked the IPA and all files are in there. Again, however, when using the preview (with assistant editor) it pulls from the corresponding .string file as I change the language.
May ’18
translation project only uses first and last items in a Numbers cell range
I need to translate various items from a Numbers file. I used chatGPT to help me write a script which receives a cell range and translates them using Google Translate. The problem I am having is that it only translates the first and last items in the desired cell range. Please help me integrate a way to have it translate the whole range, i.e (D435:D440). Here is the script: -- Define the document file path set filePath to file path here -- Define the sheet, table, and cell range set sheetName to Sheet 1 set tableName to Table 1 set cellRange to D429:D433 -- Function to translate text from Spanish to English using Google Translate API on translateText(textToTranslate) set baseURL to https://translate.googleapis.com/translate_a/single?client=gtx&sl=es&tl=en&dt=t&q= set encodedText to do shell script python -c import urllib, sys; print urllib.quote(sys.argv[1]) & quoted form of textToTranslate set translatedText to do shell scrip
1
0
752
Mar ’24
Flipping the card with transform: translate(100%,0) makes the links not clickable on the card
Issue specifically happens with IOS16.4 and above (both on Chrome and Safari). The same code works across all other browsers and IOS 16.3 and below as well. Below is the CSS code for the card flip (backside of the card) -webkit-transform: rotateY(-180deg) translate(100%, 0); transform: rotateY(-180deg) translate(100%, 0); When the card is flipped, on the backside - no clicks were clickable. translate(100%,0) is the culprit after debugging for many hours. I am not sure what is the alternate solution and/or why this started failing only from iOS16.4 and above. Any insights to this issue would be highly appreciated as I spent way too much of time troubleshooting this stupid issue.
Topic: Safari & Web SubTopic: General Tags:
0
0
842
Jun ’23
How to translate data from c language void * pointer to [UInt8 ] in swift code.
A swift function name as getDataFromC which can connect with C function. A C function name as ExternalMethod which will receive the connect from swift. The parameter will be fill by call setData function. I can confirm that the entire structure return to getDataFromC was successful. Because I print the data of other structure members to check the correctness of the data. However, I don't know how to translate the largeData to [UInt8]. I try UnsafeMutableRawPointer type. I don't know what to do for the following action. I expected that output.largeData can be translate to [UInt8] type. //Bridging header file struct myStruct { void *largeData; int largeDataLength; int smallData[3]; } //C file void setData(myStruct* data) { int i = 0; uint8_t array[1024]; memset(array,0x66,1024); data->largeData = array; data->largeDataLength = 1024; data->smalData[0] = 0x99; data->smalData[0] = 0x88; data->smalData[0] = 0x77; } void ExternalMethod(myStruct* data) { setData(&output); } //Swif
2
0
570
Dec ’23
new classes .h .cpp Xcode, translate from Visual Studio
Good morning, I am very beginners student of openFrameworks. I'm following a tutorial trying to create a new class with openFrameworks but I cannot compile it in the right way. This because the tutorial I found in on Visual Studio and i'm working on a Mac with Xcode. This problem is blocking me and I cannot go on with the course. Can someone help me translate the code to create a new class from Visual Studio to Xcode? The language is the same, but the programme in this case is slightly different. On Visual Studio the files are Class.H and Class.Cpp THIS IS CLASS.H VISUAL STUDIO #pragma once #include ofMain.h class ball { public: ball(); void setup (ofVec2f initialPos, ofVec2f initialVel, float rad); void update (); void draw(); ofVec2f pos; ofVec2f vel; ofVec2f radius; }; CLASS.CPP VISUAL STUDIO #include ball.h ball :: ball();{ } void ball :: setup(ofVec2f initialPos, ofVec2f initialVel, float rad); { ofVec2f initialPos; ofVec2f initialVel; float rad; } //---------------------------------------------
1
0
824
Aug ’23
Translation Framework: Code 16 "Offline models not available" despite status showing .installed
Hi everyone, I'm experiencing an inconsistent behavior with the Translation framework on iOS 18. The LanguageAvailability.status() API reports language models as .installed, but translation fails with Code 16. Setup: Using translationTask modifier with TranslationSession Batch translation with explicit source/target languages Languages: Portuguese→English, German→English Issue: let status = await LanguageAvailability().status(from: sourceLang, to: targetLang) // Returns: .installed // But translation fails: let responses = try await session.translations(from: requests) // Error: TranslationErrorDomain Code=16 Offline models not available Logs: Language model installed: pt -> en Language model installed: de -> en Starting translation: de -> en Error Domain=TranslationErrorDomain Code=16 Translation failedNSLocalizedFailureReason=Offline models not available for language pair What I've tried: Re-downloading languages in Settings Using source: nil fo
1
0
453
Jan ’26
Parent is changed during gesture interaction producing incorrect relative translation values.
I'm having trouble re-setting the position of a child entity during app re-load even though it appears that I am correctly obtaining and persisting the correct translation values after a drag gesture. The problem exists when I drag a child element to a new location (persist those new values) then reload the app to force re-positioning from persisted translation values. I notice that the parent relationship changes during interaction (tap or drag) which can be seen in the debug statements. I'm wondering if this is related to the problem, or, if the parent change is normal during re-rendering and is un-related to my problem. My thought process is since we care about relative translation values when persisting, if the parent relationship is changed just before persistence, then, are we persisting and setting the wrong values? Project Link: Private STEPS TO REPRODUCE Run the app. Drag the pre-loaded stage down the Y axis so that the floor of the stage is more visible to your eye (in ord
1
0
534
Nov ’24
Camera permission Alert "OK" button not getting translated for Japanese language
We are supporting multi langauge text in our application. But at the time of camera permision(First time after app installation) we found that in some of langauges like japanese, dutch etc the OK button text in the alert is not translatedand rest of the components are getting transalted properly. But for few the languages OK button text is getting translated properly.Our users are reporting this as a bug, where we found that it is totally derived from apple.Could you please help us to guide on the same.
0
0
409
Jul ’19
Is this the correct translation from Objective-C code to Swift?
Hi all,In AVCameraCalibrationData.h there is reference implementation on how to correct images for lens distortion. I am using this code to undistort the AVDepthData. I was wondering whether I did the translation from Objective-C to Swift correct?Thank you.This is objective-c:- (CGPoint)lensDistortionPointForPoint:(CGPoint)point lookupTable:(NSData *)lookupTable distortionOpticalCenter:(CGPoint)opticalCenter imageSize:(CGSize)imageSize { // The lookup table holds the relative radial magnification for n linearly spaced radii. // The first position corresponds to radius = 0 // The last position corresponds to the largest radius found in the image. // Determine the maximum radius. float delta_ocx_max = MAX( opticalCenter.x, imageSize.width - opticalCenter.x ); float delta_ocy_max = MAX( opticalCenter.y, imageSize.height - opticalCenter.y ); float r_max = sqrtf( delta_ocx_max * delta_ocx_max + delta_ocy_max * delta_ocy_max ); // Determine the vector from the optical center to the given point. float v_poi
4
0
2.1k
Jul ’18
Import localizations error: "Two files will try to write translations to same path"
I have Xcode 13.3.1. To export localizations file, I choose Export Localizations option in the Product menu, then I choose MyApp Workspace... option, and I choose a folder, then export. Two files are created en.xcloc and xx.xcloc, because my app supports two languages, English and XX. Then I edit the exported xx.xcloc localizations file, then try to import the file to Xcode as I always do without any issue. However, this time I get the following error: Two files will try to write translations to same path MyApp/Other/Settings.bundle/en.lproj MyApp/Other/Settings.bundle/xx.lproj Rename or move one of the files What's going on here, and how should I solve this issue?
3
0
1.8k
May ’22
Reply to Apple Translate App URL Scheme
Hi @ryrous, thanks for your interest in integrating with the Translate app. While I'm not sure about a URL scheme to launch the app, if you're hoping to provide translation functionality in your app you have a few options: Allow users to use standard text selection in your app. Then they can select text, choose Translate and see a translation within your app. Adopt the .translationPresentation() API to programmatically invoke the translation UI described in #1. You can add a Translate button that triggers this and shows the UI to the user. There's even an option in that UI to Open in Translate if the user chooses to do so. Have more control over translating text and displaying it within your app by adopting .translationTask and using TranslationSession APIs. This allows you to use the same translation engine as the Translate app from within your app, and display results however you'd like. For more information s
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
String Catalog Symbols: No Reference-Language Fallback for Partially Translated Locales
I'm having troubles converting my string catalog to symbols because for partly translated languages there is no fallback to the reference language. Let me give you an example. Example Assume an app that supports two languages: English and Japanese. The app is very simple and has only two strings, using symbols in a String Catalog: Key: .helloWorld → “Hello World!” Key: .info → “Information” Case 1: No Japanese translations If I launch the app in Japanese and neither string is translated, English is used as a fallback. The UI shows: “Hello World!” “Information” This is exactly what I would expect. Case 2: Only one string translated Now assume I translate only one string into Japanese: .helloWorld → “こんにちは世界” When I launch the app in Japanese now: .helloWorld correctly shows “こんにちは世界” .info shows info, not “Information” So instead of falling back to English, the key is displayed. This issue does not pop up when I don't use symbols. Because then, my SwiftUI Text eleme
Replies
1
Boosts
0
Views
123
Activity
Feb ’26
Translating swift to objective C "for in loop" NSString (I think) in NSDictionary
I'm currently stuck translating the code below for my apps database in firebase:Swift :var databaseRef = FIRDatabase.database().reference() var userDict = NSDictionary?() var userNamesArray = [String]() var userImagesArray = [String]() override func viewDidLoad() { super.viewDidLoad() self.databaseRef.child(@users).observeEventType(.Value, withBlock : { (snapshot in self.userDict = snapshot.value as? NSDictionary for(userId,details) in self.userDict!{ let img = details.objectForKey(@profile_pic_small as! String let name = details.objectForKey(@Name as! String let firstName = name.componentsSeperatedByString( )[0] self.userImagesArray.append(img) self.userNamesArray.append(firstName) self.collectionView?.reloadData() } })The code below is my attempt at translating but i'm definetly missing something:- (void)viewDidLoad { [super viewDidLoad]; _userNamesArray = [NSMutableArray new]; _userImagesArray = [NSMutableArray new]; self.databaseRef = [[FIRDatabase database] reference]; [[_databaseRef ch
Replies
0
Boosts
0
Views
584
Activity
Sep ’16
Reply to MyApp is calling TIS/TSM in non-main thread environment
I expect that message is coming from the Main Thread Checker: https://developer.apple.com/documentation/code_diagnostics/main_thread_checkerTIS = Text Input SourcesTSM = Text Services ManagerYou're doing something like trying to translate key events to characters on a background thread.There's a setting in the Scheme editor to make your app pause when it hits such a problem, so you can see the stack trace.
Replies
Boosts
Views
Activity
Jun ’18
Language Translation
when we launch the application and change the language from german/french to english or any other language then in also it is changing app language, but bluetooth connection screen with pair or cancel alert is showing on previous selected language. Since that alert is system alert, is there any wayto debug/resolve that issue.
Replies
2
Boosts
0
Views
527
Activity
Jan ’25
Reply to localization works in preview but not in simulator or device
Yes, strings traslations work with .strings / NSLocalizedStringTable. Actually, I need to correct my self. Both nibs and strings translations work technically. The issue is that for the framework it uses the same translations regardless of what language/region I set on the scheme. It seems that it selects whichever is last alphabetically in the directory. I added several languages to test it, and it would always show whichever wast last. Initially I thought it would select whichever was added last, but I tested adding Ukraine before adding French, and still showed Ukraine. The same behavior happens with string (.strings) translations. I checked the IPA and all files are in there. Again, however, when using the preview (with assistant editor) it pulls from the corresponding .string file as I change the language.
Replies
Boosts
Views
Activity
May ’18
translation project only uses first and last items in a Numbers cell range
I need to translate various items from a Numbers file. I used chatGPT to help me write a script which receives a cell range and translates them using Google Translate. The problem I am having is that it only translates the first and last items in the desired cell range. Please help me integrate a way to have it translate the whole range, i.e (D435:D440). Here is the script: -- Define the document file path set filePath to file path here -- Define the sheet, table, and cell range set sheetName to Sheet 1 set tableName to Table 1 set cellRange to D429:D433 -- Function to translate text from Spanish to English using Google Translate API on translateText(textToTranslate) set baseURL to https://translate.googleapis.com/translate_a/single?client=gtx&sl=es&tl=en&dt=t&q= set encodedText to do shell script python -c import urllib, sys; print urllib.quote(sys.argv[1]) & quoted form of textToTranslate set translatedText to do shell scrip
Replies
1
Boosts
0
Views
752
Activity
Mar ’24
Flipping the card with transform: translate(100%,0) makes the links not clickable on the card
Issue specifically happens with IOS16.4 and above (both on Chrome and Safari). The same code works across all other browsers and IOS 16.3 and below as well. Below is the CSS code for the card flip (backside of the card) -webkit-transform: rotateY(-180deg) translate(100%, 0); transform: rotateY(-180deg) translate(100%, 0); When the card is flipped, on the backside - no clicks were clickable. translate(100%,0) is the culprit after debugging for many hours. I am not sure what is the alternate solution and/or why this started failing only from iOS16.4 and above. Any insights to this issue would be highly appreciated as I spent way too much of time troubleshooting this stupid issue.
Topic: Safari & Web SubTopic: General Tags:
Replies
0
Boosts
0
Views
842
Activity
Jun ’23
How to translate data from c language void * pointer to [UInt8 ] in swift code.
A swift function name as getDataFromC which can connect with C function. A C function name as ExternalMethod which will receive the connect from swift. The parameter will be fill by call setData function. I can confirm that the entire structure return to getDataFromC was successful. Because I print the data of other structure members to check the correctness of the data. However, I don't know how to translate the largeData to [UInt8]. I try UnsafeMutableRawPointer type. I don't know what to do for the following action. I expected that output.largeData can be translate to [UInt8] type. //Bridging header file struct myStruct { void *largeData; int largeDataLength; int smallData[3]; } //C file void setData(myStruct* data) { int i = 0; uint8_t array[1024]; memset(array,0x66,1024); data->largeData = array; data->largeDataLength = 1024; data->smalData[0] = 0x99; data->smalData[0] = 0x88; data->smalData[0] = 0x77; } void ExternalMethod(myStruct* data) { setData(&output); } //Swif
Replies
2
Boosts
0
Views
570
Activity
Dec ’23
new classes .h .cpp Xcode, translate from Visual Studio
Good morning, I am very beginners student of openFrameworks. I'm following a tutorial trying to create a new class with openFrameworks but I cannot compile it in the right way. This because the tutorial I found in on Visual Studio and i'm working on a Mac with Xcode. This problem is blocking me and I cannot go on with the course. Can someone help me translate the code to create a new class from Visual Studio to Xcode? The language is the same, but the programme in this case is slightly different. On Visual Studio the files are Class.H and Class.Cpp THIS IS CLASS.H VISUAL STUDIO #pragma once #include ofMain.h class ball { public: ball(); void setup (ofVec2f initialPos, ofVec2f initialVel, float rad); void update (); void draw(); ofVec2f pos; ofVec2f vel; ofVec2f radius; }; CLASS.CPP VISUAL STUDIO #include ball.h ball :: ball();{ } void ball :: setup(ofVec2f initialPos, ofVec2f initialVel, float rad); { ofVec2f initialPos; ofVec2f initialVel; float rad; } //---------------------------------------------
Replies
1
Boosts
0
Views
824
Activity
Aug ’23
Translation Framework: Code 16 "Offline models not available" despite status showing .installed
Hi everyone, I'm experiencing an inconsistent behavior with the Translation framework on iOS 18. The LanguageAvailability.status() API reports language models as .installed, but translation fails with Code 16. Setup: Using translationTask modifier with TranslationSession Batch translation with explicit source/target languages Languages: Portuguese→English, German→English Issue: let status = await LanguageAvailability().status(from: sourceLang, to: targetLang) // Returns: .installed // But translation fails: let responses = try await session.translations(from: requests) // Error: TranslationErrorDomain Code=16 Offline models not available Logs: Language model installed: pt -> en Language model installed: de -> en Starting translation: de -> en Error Domain=TranslationErrorDomain Code=16 Translation failedNSLocalizedFailureReason=Offline models not available for language pair What I've tried: Re-downloading languages in Settings Using source: nil fo
Replies
1
Boosts
0
Views
453
Activity
Jan ’26
Parent is changed during gesture interaction producing incorrect relative translation values.
I'm having trouble re-setting the position of a child entity during app re-load even though it appears that I am correctly obtaining and persisting the correct translation values after a drag gesture. The problem exists when I drag a child element to a new location (persist those new values) then reload the app to force re-positioning from persisted translation values. I notice that the parent relationship changes during interaction (tap or drag) which can be seen in the debug statements. I'm wondering if this is related to the problem, or, if the parent change is normal during re-rendering and is un-related to my problem. My thought process is since we care about relative translation values when persisting, if the parent relationship is changed just before persistence, then, are we persisting and setting the wrong values? Project Link: Private STEPS TO REPRODUCE Run the app. Drag the pre-loaded stage down the Y axis so that the floor of the stage is more visible to your eye (in ord
Replies
1
Boosts
0
Views
534
Activity
Nov ’24
Camera permission Alert "OK" button not getting translated for Japanese language
We are supporting multi langauge text in our application. But at the time of camera permision(First time after app installation) we found that in some of langauges like japanese, dutch etc the OK button text in the alert is not translatedand rest of the components are getting transalted properly. But for few the languages OK button text is getting translated properly.Our users are reporting this as a bug, where we found that it is totally derived from apple.Could you please help us to guide on the same.
Replies
0
Boosts
0
Views
409
Activity
Jul ’19
Is this the correct translation from Objective-C code to Swift?
Hi all,In AVCameraCalibrationData.h there is reference implementation on how to correct images for lens distortion. I am using this code to undistort the AVDepthData. I was wondering whether I did the translation from Objective-C to Swift correct?Thank you.This is objective-c:- (CGPoint)lensDistortionPointForPoint:(CGPoint)point lookupTable:(NSData *)lookupTable distortionOpticalCenter:(CGPoint)opticalCenter imageSize:(CGSize)imageSize { // The lookup table holds the relative radial magnification for n linearly spaced radii. // The first position corresponds to radius = 0 // The last position corresponds to the largest radius found in the image. // Determine the maximum radius. float delta_ocx_max = MAX( opticalCenter.x, imageSize.width - opticalCenter.x ); float delta_ocy_max = MAX( opticalCenter.y, imageSize.height - opticalCenter.y ); float r_max = sqrtf( delta_ocx_max * delta_ocx_max + delta_ocy_max * delta_ocy_max ); // Determine the vector from the optical center to the given point. float v_poi
Replies
4
Boosts
0
Views
2.1k
Activity
Jul ’18
Import localizations error: "Two files will try to write translations to same path"
I have Xcode 13.3.1. To export localizations file, I choose Export Localizations option in the Product menu, then I choose MyApp Workspace... option, and I choose a folder, then export. Two files are created en.xcloc and xx.xcloc, because my app supports two languages, English and XX. Then I edit the exported xx.xcloc localizations file, then try to import the file to Xcode as I always do without any issue. However, this time I get the following error: Two files will try to write translations to same path MyApp/Other/Settings.bundle/en.lproj MyApp/Other/Settings.bundle/xx.lproj Rename or move one of the files What's going on here, and how should I solve this issue?
Replies
3
Boosts
0
Views
1.8k
Activity
May ’22