8

Tôi đã triển khai FBSDKLikeControl trong dự án của mình và kỳ vọng của tôi là thay đổi văn bản 'thích' và 'thích' thành ngôn ngữ thiết bị được kính trọng (ar-AE). Nhưng miền địa phương không thay đổi như mong đợi, nó chỉ hiển thị văn bản tiếng Anh chứ không phải văn bản tiếng Ả Rập cho 'thích' và 'thích'.Văn bản tiêu đề FBSDKLikeControl không thay đổi sự tôn trọng ngôn ngữ thiết bị 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]; 

có thể bất kỳ một đề nghị làm thế nào tôi có thể thiết lập miền địa phương cho FBLikeButton programatically

+0

bạn có thể hiển thị mã của bạn –

Trả lời

1

phần mã hóa của bạn là đúng, Ngày FacebookSDKStrings.bundle tùy chọn để cung cấp dây cục bộ cho các ứng dụng quốc tế, vì vậy bạn cần phải bao gồm các FacebookSDKStrings.bundle để dự án của bạn và nó hoạt động như mong đợi đối với tôi,

Sau đây là trong en.lproj FacebookSDKStrings.bundle (FacebookSDK.string), do đó khi bạn thêm này bó nó sẽ tự động thay đổi địa phương dựa trên ngôn ngữ thiết bị để chia sẻ và nút

/* 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"; 

như tham khảo: Facebook change log for more details

Stack overflow link have more info

+1

right @balakrishnan Mac, thay đổi nhật ký rõ ràng đề cập đến tùy chọn của nó, vì vậy chúng ta cần phải thêm vào gói dự án, cho dù ứng dụng sử dụng địa phương quốc tế, bây giờ làm việc như mong đợi, cảm ơn rất nhiều – Manobala

2

Dưới đây là một số chỉ dẫn về cách thực hiện dịch của riêng bạn:

iOS Facebook SDK localization

Sau khi tìm kiếm ở đây: https://developers.facebook.com/docs/internationalization#locales

Bạn có thể tìm tệp tin Facebook XML chứa thông tin địa phương ())

Nó chỉ ra rằng họ sử dụng ar_AR chỉ cho arabic, và không ar_AE, đó có thể là lý do.

+1

của bạn liên kết stack overflow trong dòng cuối cùng có câu trả lời này, nhưng tôi thougt liên kết nội địa hóa FBSDK của nó và tôi skiped nó previosly thanks a lot – Manobala

+0

có bạn đang @manobala đúng, tôi cũng có cùng một suy nghĩ liên kết trang phát triển FB của nó, nếu tôi nhận thấy trước khi tôi có thể chỉnh sửa câu trả lời này hoặc chỉ đăng liên kết đăng nhập thay đổi, làm việc tốt yann kaiser, giữ nó lên :) –

+0

có thể đề xuất làm thế nào tôi có thể đặt ngôn ngữ cho FBLikeButton programatically – Manobala

Các vấn đề liên quan