1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-27 17:08:00 +01:00

i18n resource strings for app extension

This commit is contained in:
Kyle Spearrin 2016-11-25 17:05:14 -05:00
parent 8322e49305
commit d8559a81f4
11 changed files with 141 additions and 29 deletions

View File

@ -115,7 +115,8 @@ namespace Bit.App.Pages
{
if(string.IsNullOrWhiteSpace(PasswordCell.Entry.Text))
{
await DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired, AppResources.MasterPassword), AppResources.Ok);
await DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired,
AppResources.MasterPassword), AppResources.Ok);
return;
}

View File

@ -304,6 +304,33 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Copied!.
/// </summary>
public static string Copied {
get {
return ResourceManager.GetString("Copied", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copied password!.
/// </summary>
public static string CopiedPassword {
get {
return ResourceManager.GetString("CopiedPassword", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copied username!.
/// </summary>
public static string CopiedUsername {
get {
return ResourceManager.GetString("CopiedUsername", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Copy.
/// </summary>
@ -556,6 +583,24 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Your logins are now easily accessable from Safari, Chrome, and other supported apps..
/// </summary>
public static string ExtensionSetup {
get {
return ResourceManager.GetString("ExtensionSetup", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to In Safari and Chrome, find bitwarden using the share icon (hint: scroll to the right on the bottom row of the share menu)..
/// </summary>
public static string ExtensionSetup2 {
get {
return ResourceManager.GetString("ExtensionSetup2", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Tap the bitwarden icon in the menu to launch the extension..
/// </summary>
@ -1033,6 +1078,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to You must log into the main bitwarden app before you can use the extension..
/// </summary>
public static string MustLogInMainApp {
get {
return ResourceManager.GetString("MustLogInMainApp", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to My Vault.
/// </summary>
@ -1096,6 +1150,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to There are no sites in your vault for this website. Tap to add one..
/// </summary>
public static string NoSitesTap {
get {
return ResourceManager.GetString("NoSitesTap", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Notes.
/// </summary>
@ -1105,6 +1168,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to This site does not have a username or password configured..
/// </summary>
public static string NoUsernamePasswordConfigured {
get {
return ResourceManager.GetString("NoUsernamePasswordConfigured", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ok.
/// </summary>
@ -1123,6 +1195,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Option defaults are set from the main bitwarden app&apos;s password generator tool..
/// </summary>
public static string OptionDefaults {
get {
return ResourceManager.GetString("OptionDefaults", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Options.
/// </summary>

View File

@ -448,6 +448,15 @@
<data name="Continue" xml:space="preserve">
<value>Continue</value>
</data>
<data name="Copied" xml:space="preserve">
<value>Copied!</value>
</data>
<data name="CopiedPassword" xml:space="preserve">
<value>Copied password!</value>
</data>
<data name="CopiedUsername" xml:space="preserve">
<value>Copied username!</value>
</data>
<data name="CreateAccount" xml:space="preserve">
<value>Create Account</value>
</data>
@ -492,6 +501,12 @@
<data name="ExtensionSeeApps" xml:space="preserve">
<value>See Supported Apps</value>
</data>
<data name="ExtensionSetup" xml:space="preserve">
<value>Your logins are now easily accessable from Safari, Chrome, and other supported apps.</value>
</data>
<data name="ExtensionSetup2" xml:space="preserve">
<value>In Safari and Chrome, find bitwarden using the share icon (hint: scroll to the right on the bottom row of the share menu).</value>
</data>
<data name="ExtensionTapIcon" xml:space="preserve">
<value>Tap the bitwarden icon in the menu to launch the extension.</value>
</data>
@ -582,6 +597,9 @@
<data name="MoreSettings" xml:space="preserve">
<value>More Settings</value>
</data>
<data name="MustLogInMainApp" xml:space="preserve">
<value>You must log into the main bitwarden app before you can use the extension.</value>
</data>
<data name="Never" xml:space="preserve">
<value>Never</value>
</data>
@ -594,10 +612,19 @@
<data name="NoSites" xml:space="preserve">
<value>There are no sites in your vault.</value>
</data>
<data name="NoSitesTap" xml:space="preserve">
<value>There are no sites in your vault for this website. Tap to add one.</value>
</data>
<data name="NoUsernamePasswordConfigured" xml:space="preserve">
<value>This site does not have a username or password configured.</value>
</data>
<data name="OkGotIt" xml:space="preserve">
<value>Ok, got it!</value>
<comment>Confirmation, like "Ok, I understand it"</comment>
</data>
<data name="OptionDefaults" xml:space="preserve">
<value>Option defaults are set from the main bitwarden app's password generator tool.</value>
</data>
<data name="Options" xml:space="preserve">
<value>Options</value>
</data>

View File

@ -90,8 +90,7 @@ namespace Bit.iOS.Extension
var authService = Resolver.Resolve<IAuthService>();
if(!authService.IsAuthenticated)
{
var alert = Dialogs.CreateAlert(null,
"You must log into the main bitwarden app before you can use the extension.", AppResources.Ok, (a) =>
var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) =>
{
CompleteRequest(null);
});

View File

@ -7,6 +7,7 @@ using Plugin.Fingerprint.Abstractions;
using System.Threading.Tasks;
using Bit.App;
using Bit.iOS.Core.Controllers;
using Bit.App.Resources;
namespace Bit.iOS.Extension
{
@ -67,7 +68,7 @@ namespace Bit.iOS.Extension
public async Task CheckFingerprintAsync()
{
var result = await _fingerprint.AuthenticateAsync("Use your fingerprint to verify.");
var result = await _fingerprint.AuthenticateAsync(AppResources.FingerprintDirection);
if(result.Authenticated)
{
_settings.AddOrUpdateValue(Constants.Locked, false);

View File

@ -94,7 +94,7 @@ namespace Bit.iOS.Extension
// TODO: keep track of invalid attempts and logout?
var alert = Dialogs.CreateAlert(AppResources.AnErrorHasOccurred,
string.Format(null, "Invalid Master Password. Try again."), AppResources.Ok, (a) =>
string.Format(null, AppResources.InvalidMasterPassword), AppResources.Ok, (a) =>
{
MasterPasswordCell.TextField.Text = string.Empty;

View File

@ -73,7 +73,7 @@ namespace Bit.iOS.Extension
{
// TODO: keep track of invalid attempts and logout?
var alert = Dialogs.CreateAlert(null, "Invalid PIN. Try again.", AppResources.Ok, (a) =>
var alert = Dialogs.CreateAlert(null, AppResources.InvalidPIN, AppResources.Ok, (a) =>
{
PinTextField.Text = string.Empty;
SetLabelText();

View File

@ -11,6 +11,7 @@ using CoreGraphics;
using Bit.App;
using Bit.iOS.Core.Utilities;
using Bit.iOS.Core.Controllers;
using Bit.App.Resources;
namespace Bit.iOS.Extension
{
@ -30,9 +31,9 @@ namespace Bit.iOS.Extension
public SwitchTableViewCell LowercaseCell { get; set; } = new SwitchTableViewCell("a-z");
public SwitchTableViewCell NumbersCell { get; set; } = new SwitchTableViewCell("0-9");
public SwitchTableViewCell SpecialCell { get; set; } = new SwitchTableViewCell("!@#$%^&*");
public StepperTableViewCell MinNumbersCell { get; set; } = new StepperTableViewCell("Minimum Numbers", 1, 0, 5, 1);
public StepperTableViewCell MinSpecialCell { get; set; } = new StepperTableViewCell("Minimum Special", 1, 0, 5, 1);
public SliderTableViewCell LengthCell { get; set; } = new SliderTableViewCell("Length", 10, 5, 64);
public StepperTableViewCell MinNumbersCell { get; set; } = new StepperTableViewCell(AppResources.MinNumbers, 1, 0, 5, 1);
public StepperTableViewCell MinSpecialCell { get; set; } = new StepperTableViewCell(AppResources.MinSpecial, 1, 0, 5, 1);
public SliderTableViewCell LengthCell { get; set; } = new SliderTableViewCell(AppResources.Length, 10, 5, 64);
public override void ViewWillAppear(bool animated)
{
@ -202,11 +203,11 @@ namespace Bit.iOS.Extension
cell.TextLabel.TextColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
if(indexPath.Row == 0)
{
cell.TextLabel.Text = "Regenerate Password";
cell.TextLabel.Text = AppResources.RegeneratePassword;
}
else if(indexPath.Row == 1)
{
cell.TextLabel.Text = "Copy Password";
cell.TextLabel.Text = AppResources.CopyPassword;
}
return cell;
}
@ -290,7 +291,7 @@ namespace Bit.iOS.Extension
{
if(section == 1)
{
return "Options";
return AppResources.Options;
}
return null;
@ -300,7 +301,7 @@ namespace Bit.iOS.Extension
{
if(section == 1)
{
return "Option defaults are set from the main bitwarden app's password generator tool.";
return AppResources.OptionDefaults;
}
return null;
@ -320,7 +321,7 @@ namespace Bit.iOS.Extension
_controller._googleAnalyticsService.TrackExtensionEvent("CopiedGeneratedPassword");
UIPasteboard clipboard = UIPasteboard.General;
clipboard.String = _controller.PasswordLabel.Text;
var alert = Dialogs.CreateMessageAlert("Copied!");
var alert = Dialogs.CreateMessageAlert(AppResources.Copied);
_controller.PresentViewController(alert, true, () =>
{
_controller.DismissViewController(true, null);

View File

@ -3,6 +3,7 @@ using Bit.iOS.Extension.Models;
using UIKit;
using Plugin.Settings.Abstractions;
using Bit.iOS.Core.Controllers;
using Bit.App.Resources;
namespace Bit.iOS.Extension
{
@ -25,9 +26,9 @@ namespace Bit.iOS.Extension
{
View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);
var descriptor = UIFontDescriptor.PreferredBody;
DescriptionLabel.Text = @"Your logins are now easily accessable from Safari, Chrome, and other supported apps.
DescriptionLabel.Text = $@"{AppResources.ExtensionSetup}
In Safari and Chrome, find bitwarden using the share icon (hint: scroll to the right on the bottom row of the share menu).";
{AppResources.ExtensionSetup2}";
DescriptionLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
DescriptionLabel.TextColor = new UIColor(red: 0.47f, green: 0.47f, blue: 0.47f, alpha: 1.0f);
ActivatedLabel.Font = UIFont.FromDescriptor(descriptor, descriptor.PointSize * 1.3f);

View File

@ -36,7 +36,7 @@ namespace Bit.iOS.Extension
public FormEntryTableViewCell UsernameCell { get; set; } = new FormEntryTableViewCell(AppResources.Username);
public FormEntryTableViewCell PasswordCell { get; set; } = new FormEntryTableViewCell(AppResources.Password);
public UITableViewCell GeneratePasswordCell { get; set; } = new UITableViewCell(UITableViewCellStyle.Subtitle, "GeneratePasswordCell");
public SwitchTableViewCell FavoriteCell { get; set; } = new SwitchTableViewCell("Favorite");
public SwitchTableViewCell FavoriteCell { get; set; } = new SwitchTableViewCell(AppResources.Favorite);
public FormEntryTableViewCell NotesCell { get; set; } = new FormEntryTableViewCell(useTextView: true, height: 90);
public PickerTableViewCell FolderCell { get; set; } = new PickerTableViewCell(AppResources.Folder);
@ -91,7 +91,7 @@ namespace Bit.iOS.Extension
return true;
};
GeneratePasswordCell.TextLabel.Text = "Generate Password";
GeneratePasswordCell.TextLabel.Text = AppResources.GeneratePassword;
GeneratePasswordCell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
_folders = _folderService.GetAllAsync().GetAwaiter().GetResult();
@ -160,7 +160,7 @@ namespace Bit.iOS.Extension
};
var saveTask = _siteService.SaveAsync(site);
var loadingAlert = Dialogs.CreateLoadingAlert("Saving...");
var loadingAlert = Dialogs.CreateLoadingAlert(AppResources.Saving);
PresentViewController(loadingAlert, true, null);
await saveTask;
@ -299,11 +299,11 @@ namespace Bit.iOS.Extension
{
if(section == 0)
{
return "Site Information";
return AppResources.SiteInformation;
}
else if(section == 2)
{
return "Notes";
return AppResources.Notes;
}
return null;

View File

@ -13,6 +13,7 @@ using System.Threading.Tasks;
using Bit.iOS.Core;
using MobileCoreServices;
using Bit.iOS.Core.Controllers;
using Bit.App.Resources;
namespace Bit.iOS.Extension
{
@ -36,7 +37,7 @@ namespace Bit.iOS.Extension
base.ViewDidLoad();
if(!CanAutoFill())
{
CancelBarButton.Title = "Close";
CancelBarButton.Title = AppResources.Close;
}
TableView.RowHeight = UITableView.AutomaticDimension;
@ -132,7 +133,7 @@ namespace Bit.iOS.Extension
if(_tableItems.Count() == 0)
{
var noDataCell = new UITableViewCell(UITableViewCellStyle.Default, "NoDataCell");
noDataCell.TextLabel.Text = "There are no sites in your vault for this website. Tap to add one.";
noDataCell.TextLabel.Text = AppResources.NoSitesTap;
noDataCell.TextLabel.TextAlignment = UITextAlignment.Center;
noDataCell.TextLabel.LineBreakMode = UILineBreakMode.WordWrap;
noDataCell.TextLabel.Lines = 0;
@ -190,11 +191,11 @@ namespace Bit.iOS.Extension
var sheet = Dialogs.CreateActionSheet(item.Name, _controller);
if(!string.IsNullOrWhiteSpace(item.Username))
{
sheet.AddAction(UIAlertAction.Create("Copy Username", UIAlertActionStyle.Default, a =>
sheet.AddAction(UIAlertAction.Create(AppResources.CopyUsername, UIAlertActionStyle.Default, a =>
{
UIPasteboard clipboard = UIPasteboard.General;
clipboard.String = item.Username;
var alert = Dialogs.CreateMessageAlert("Copied username!");
var alert = Dialogs.CreateMessageAlert(AppResources.CopyUsername);
_controller.PresentViewController(alert, true, () =>
{
_controller.DismissViewController(true, null);
@ -204,11 +205,11 @@ namespace Bit.iOS.Extension
if(!string.IsNullOrWhiteSpace(item.Password))
{
sheet.AddAction(UIAlertAction.Create("Copy Password", UIAlertActionStyle.Default, a =>
sheet.AddAction(UIAlertAction.Create(AppResources.CopyPassword, UIAlertActionStyle.Default, a =>
{
UIPasteboard clipboard = UIPasteboard.General;
clipboard.String = item.Password;
var alert = Dialogs.CreateMessageAlert("Copied password!");
var alert = Dialogs.CreateMessageAlert(AppResources.CopiedPassword);
_controller.PresentViewController(alert, true, () =>
{
_controller.DismissViewController(true, null);
@ -216,12 +217,12 @@ namespace Bit.iOS.Extension
}));
}
sheet.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null));
sheet.AddAction(UIAlertAction.Create(AppResources.Cancel, UIAlertActionStyle.Cancel, null));
_controller.PresentViewController(sheet, true, null);
}
else
{
var alert = Dialogs.CreateAlert(null, "This site does not have a username or password configured.", "Ok");
var alert = Dialogs.CreateAlert(null, AppResources.NoUsernamePasswordConfigured, AppResources.Ok);
_controller.PresentViewController(alert, true, null);
}
}