8

我已經在我的項目中實現了FBSDKLikeControl,並且我的期望是「喜歡」和「喜歡」文本更改爲尊重設備區域設置(ar-AE)。但區域設置沒有像預期的那樣改變,它只是簡單地顯示英文文本,而不是像'喜歡'和'喜歡'的阿拉伯文字。FBSDKLikeControl標題文本不改變對設備區域設置的尊重FBSDK ios

self.buttonFBLike = [[FBSDKLikeControl alloc] init]; 
self.buttonFBLike.center=self.view.center; 
self.buttonFBLike.likeControlStyle=FBSDKLikeControlStyleBoxCount; 
[self.view addSubview:self.buttonFBLike] 
// Share url like @"https://www.facebook.com/FacebookDevelopers" 
[self.buttonFBLike setObjectID:shareURL]; 
self.buttonFBLike.enabled=YES; 
[self.buttonFBLike isTouchInside]; 

任何一個可以建議我怎麼可以設置語言環境FBLikeButton編程

+0

你能證明你的代碼 –

回答

1

你的編碼部分是正確的,增加了可選FacebookSDKStrings.bundle爲國際應用本地化的字符串,所以你需要包括FacebookSDKStrings.bundle到您的項目和它的作品如預期對我來說,

以下是在FacebookSDKStrings.bundle en.lproj(FacebookSDK.string),所以一旦你添加此捆綁,將基於對喜歡並分享按鈕

/* The format string for device login instructions */ 
"DeviceLogin.LogInPrompt" = "Visit %@ on your smartphone or computer and enter the above code."; 

/* The title of the label to dismiss the alert when presenting user facing error messages */ 
"ErrorRecovery.Alert.OK" = "OK"; 

/* The title of the label to decline attempting error recovery */ 
"ErrorRecovery.Cancel" = "Cancel"; 

/* The fallback message to display to recover invalidated tokens */ 
"ErrorRecovery.Login.Suggestion" = "Please log into this app again to reconnect your Facebook account."; 

/* The title of the label to start attempting error recovery */ 
"ErrorRecovery.OK" = "OK"; 

/* The fallback message to display to retry transient errors */ 
"ErrorRecovery.Transient.Suggestion" = "The server is temporarily busy, please try again."; 

/* The label for the FBSDKLikeButton when the object is not currently liked. */ 
"LikeButton.Like" = "Like"; 

/* The label for the FBSDKLikeButton when the object is currently liked. */ 
"LikeButton.Liked" = "Liked"; 

/* The label for the FBSDKLoginButton action sheet to cancel logging out */ 
"LoginButton.CancelLogout" = "Cancel"; 

/* The label for the FBSDKLoginButton action sheet to confirm logging out */ 
"LoginButton.ConfirmLogOut" = "Log Out"; 

/* The fallback string for the FBSDKLoginButton label when the user name is not available yet */ 
"LoginButton.LoggedIn" = "Logged in using Facebook"; 

/* The format string for the FBSDKLoginButton label when the user is logged in */ 
"LoginButton.LoggedInAs" = "Logged in as %@"; 

/* The short label for the FBSDKLoginButton when the user is currently logged out */ 
"LoginButton.LogIn" = "Log in"; 

/* The long label for the FBSDKLoginButton when the user is currently logged out */ 
"LoginButton.LogInLong" = "Log in with Facebook"; 

/* The label for the FBSDKLoginButton when the user is currently logged in */ 
"LoginButton.LogOut" = "Log out"; 

/* The user facing error message when the app slider has been disabled and login fails. */ 
"LoginError.SystemAccount.Disabled" = "Access has not been granted to the Facebook account. Verify device settings."; 

/* The user facing error message when the Accounts framework encounters a network error. */ 
"LoginError.SystemAccount.Network" = "Unable to connect to Facebook. Check your network connection and try again."; 

/* The user facing error message when the device Facebook account password is incorrect and login fails. */ 
"LoginError.SystemAccount.PasswordChange" = "Your Facebook password has changed. To confirm your password, open Settings > Facebook and tap your name."; 

/* The user facing error message when the device Facebook account is unavailable and login fails. */ 
"LoginError.SystemAccount.Unavailable" = "The Facebook account has not been configured on the device."; 

/* The user facing error message when the Facebook account signed in to the Accounts framework becomes unconfirmed. */ 
"LoginError.SystemAccount.UnconfirmedUser" = "Your account is not confirmed. Please log in to www.facebook.com and follow the instructions given."; 

/* The user facing error message when the Facebook account signed in to the Accounts framework has been checkpointed. */ 
"LoginError.SystemAccount.UserCheckpointed" = "You cannot log in to apps at this time. Please log in to www.facebook.com and follow the instructions given."; 

/* The message of the FBSDKLoginTooltipView */ 
"LoginTooltip.Message" = "New! You're in control - choose what info you want to share with apps."; 

/* Title of the web dialog that prompts the user to log in to Facebook. */ 
"LoginWeb.LogInTitle" = "Log In"; 

/* The label for FBSDKSendButton */ 
"SendButton.Send" = "Send"; 

/* The label for FBSDKShareButton */ 
"ShareButton.Share" = "Share"; 

參考設備語言自動更改區域:Facebook change log for more details

Stack overflow link have more info

+1

是的,你是正確的@balakrishnan Mac,更改日誌清楚地提到了它的可選項,所以我們需要將此添加到項目捆綁包中,無論該應用程序是否使用國際本地,現在其工作如預期般,謝謝大量 – Manobala

2

下面是關於如何實現自己翻譯一些跡象表明:

iOS Facebook SDK localization

搜索以後這裏:https://developers.facebook.com/docs/internationalization#locales

您可以找到包含語言環境信息的Facebook XML文件(https://www.facebook.com/translations/FacebookLocales.xml

事實證明,他們使用ar_AR只爲阿拉伯語,而不是ar_AE,可能是這個原因。

+1

在最後一行你的堆棧溢出鏈接有這個答案,但我thougt其FBSDK定位鏈接,我skiped它previosly非常感謝 – Manobala

+0

是你的權利@manobala,我也有同樣的想法,它的FB開發者頁面鏈接,如果我注意到之前我可以編輯這個答案或只是發佈更改日誌鏈接,好的工作yann kaiser,繼續:) –

+0

可以建議如何設置FBLikeButton的區域編程 – Manobala