i18n resource strings for vault pages

This commit is contained in:
Kyle Spearrin 2016-11-25 16:42:52 -05:00
parent 620d421a4b
commit c0b6bf9f89
6 changed files with 221 additions and 33 deletions

View file

@ -67,12 +67,12 @@ namespace Bit.App.Pages
var generateCell = new ExtendedTextCell
{
Text = "Generate Password",
Text = AppResources.GeneratePassword,
ShowDisclousure = true
};
generateCell.Tapped += GenerateCell_Tapped; ;
var favoriteCell = new ExtendedSwitchCell { Text = "Favorite" };
var favoriteCell = new ExtendedSwitchCell { Text = AppResources.Favorite };
var table = new ExtendedTableView
{
@ -81,7 +81,7 @@ namespace Bit.App.Pages
HasUnevenRows = true,
Root = new TableRoot
{
new TableSection("Site Information")
new TableSection(AppResources.SiteInformation)
{
nameCell,
uriCell,
@ -141,14 +141,14 @@ namespace Bit.App.Pages
site.FolderId = folders.ElementAt(folderCell.Picker.SelectedIndex - 1).Id;
}
_userDialogs.ShowLoading("Saving...", MaskType.Black);
_userDialogs.ShowLoading(AppResources.Saving, MaskType.Black);
var saveTask = await _siteService.SaveAsync(site);
_userDialogs.HideLoading();
if(saveTask.Succeeded)
{
await Navigation.PopForDeviceAsync();
_userDialogs.Toast("New site created.");
_userDialogs.Toast(AppResources.NewSiteCreated);
_googleAnalyticsService.TrackAppEvent("CreatedSite");
}
else if(saveTask.Errors.Count() > 0)
@ -166,7 +166,7 @@ namespace Bit.App.Pages
ToolbarItems.Add(saveToolBarItem);
if(Device.OS == TargetPlatform.iOS)
{
ToolbarItems.Add(new DismissModalToolBarItem(this, "Cancel"));
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel));
}
}
@ -181,10 +181,7 @@ namespace Bit.App.Pages
if(Device.OS == TargetPlatform.iOS && !_settings.GetValueOrDefault(AddedSiteAlertKey, false))
{
_settings.AddOrUpdateValue(AddedSiteAlertKey, true);
DisplayAlert("bitwarden App Extension",
"The easiest way to add new sites to your vault is from the bitwarden App Extension. " +
"Learn more about using the bitwarden App Extension by navigating to the \"Tools\" screen.",
AppResources.Ok);
DisplayAlert(AppResources.BitwardenAppExtension, AppResources.BitwardenAppExtensionAlert, AppResources.Ok);
}
}
@ -199,7 +196,7 @@ namespace Bit.App.Pages
var page = new ToolsPasswordGeneratorPage((password) =>
{
PasswordCell.Entry.Text = password;
_userDialogs.Toast("Password generated.");
_userDialogs.Toast(AppResources.PasswordGenerated);
});
await Navigation.PushForDeviceAsync(page);
}

View file

@ -67,7 +67,7 @@ namespace Bit.App.Pages
var generateCell = new ExtendedTextCell
{
Text = "Generate Password",
Text = AppResources.GeneratePassword,
ShowDisclousure = true
};
generateCell.Tapped += GenerateCell_Tapped; ;
@ -92,7 +92,7 @@ namespace Bit.App.Pages
var favoriteCell = new ExtendedSwitchCell
{
Text = "Favorite",
Text = AppResources.Favorite,
On = site.Favorite
};
@ -106,7 +106,7 @@ namespace Bit.App.Pages
HasUnevenRows = true,
Root = new TableRoot
{
new TableSection("Site Information")
new TableSection(AppResources.SiteInformation)
{
nameCell,
uriCell,
@ -171,7 +171,7 @@ namespace Bit.App.Pages
site.FolderId = null;
}
_userDialogs.ShowLoading("Saving...", MaskType.Black);
_userDialogs.ShowLoading(AppResources.Saving, MaskType.Black);
var saveTask = await _siteService.SaveAsync(site);
_userDialogs.HideLoading();
@ -179,7 +179,7 @@ namespace Bit.App.Pages
if(saveTask.Succeeded)
{
await Navigation.PopForDeviceAsync();
_userDialogs.Toast("Site updated.");
_userDialogs.Toast(AppResources.SiteUpdated);
_googleAnalyticsService.TrackAppEvent("EditedSite");
}
else if(saveTask.Errors.Count() > 0)
@ -192,12 +192,12 @@ namespace Bit.App.Pages
}
}, ToolbarItemOrder.Default, 0);
Title = "Edit Site";
Title = AppResources.EditSite;
Content = table;
ToolbarItems.Add(saveToolBarItem);
if(Device.OS == TargetPlatform.iOS)
{
ToolbarItems.Add(new DismissModalToolBarItem(this, "Cancel"));
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Cancel));
}
}
@ -219,8 +219,7 @@ namespace Bit.App.Pages
private async void GenerateCell_Tapped(object sender, EventArgs e)
{
if(!string.IsNullOrWhiteSpace(PasswordCell.Entry.Text)
&& !await _userDialogs.ConfirmAsync("Are you sure you want to overwrite the current password?", null,
AppResources.Yes, AppResources.No))
&& !await _userDialogs.ConfirmAsync(AppResources.PasswordOverrideAlert, null, AppResources.Yes, AppResources.No))
{
return;
}
@ -228,7 +227,7 @@ namespace Bit.App.Pages
var page = new ToolsPasswordGeneratorPage((password) =>
{
PasswordCell.Entry.Text = password;
_userDialogs.Toast("Password generated.");
_userDialogs.Toast(AppResources.PasswordGenerated);
});
await Navigation.PushForDeviceAsync(page);
}
@ -246,14 +245,14 @@ namespace Bit.App.Pages
return;
}
_userDialogs.ShowLoading("Deleting...", MaskType.Black);
_userDialogs.ShowLoading(AppResources.Deleting, MaskType.Black);
var deleteTask = await _siteService.DeleteAsync(_siteId);
_userDialogs.HideLoading();
if(deleteTask.Succeeded)
{
await Navigation.PopForDeviceAsync();
_userDialogs.Toast("Site deleted.");
_userDialogs.Toast(AppResources.SiteDeleted);
_googleAnalyticsService.TrackAppEvent("DeletedSite");
}
else if(deleteTask.Errors.Count() > 0)

View file

@ -93,7 +93,7 @@ namespace Bit.App.Pages
Search = new SearchBar
{
Placeholder = "Search vault",
Placeholder = AppResources.SearchVault,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Button)),
CancelButtonColor = Color.FromHex("3c8dbc")
};
@ -110,7 +110,7 @@ namespace Bit.App.Pages
var noDataLabel = new Label
{
Text = _favorites ? "There are no favorites in your vault." : "There are no sites in your vault.",
Text = _favorites ? AppResources.NoFavorites : AppResources.NoSites,
HorizontalTextAlignment = TextAlignment.Center,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
Style = (Style)Application.Current.Resources["text-muted"]
@ -128,7 +128,7 @@ namespace Bit.App.Pages
{
var addSiteButton = new ExtendedButton
{
Text = "Add a Site",
Text = AppResources.AddASite,
Command = new Command(() => AddSite()),
Style = (Style)Application.Current.Resources["btn-primaryAccent"]
};
@ -240,12 +240,10 @@ namespace Bit.App.Pages
_settings.AddOrUpdateValue(Constants.PushInitialPromptShown, true);
_userDialogs.Alert(new AlertConfig
{
Message = "bitwarden keeps your vault automatically synced by using push notifications."
+ " For the best possible experience, please select \"Ok\" on the following prompt when"
+ " asked to enable push notifications.",
Title = "Enable Automatic Syncing",
Message = AppResources.PushNotificationAlert,
Title = AppResources.EnableAutomaticSyncing,
OnOk = registerAction,
OkText = "Ok, got it!"
OkText = AppResources.OkGotIt
});
}
else

View file

@ -77,7 +77,7 @@ namespace Bit.App.Pages
notesCell.Value.SetBinding<VaultViewSitePageModel>(Label.TextProperty, s => s.Notes);
notesCell.Value.LineBreakMode = LineBreakMode.WordWrap;
SiteInformationSection = new TableSection("Site Information")
SiteInformationSection = new TableSection(AppResources.SiteInformation)
{
nameCell
};
@ -113,7 +113,7 @@ namespace Bit.App.Pages
UriCell.Button1.WidthRequest = 71;
}
Title = "View Site";
Title = AppResources.ViewSite;
Content = Table;
BindingContext = Model;
}

View file

@ -88,6 +88,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Add a Site.
/// </summary>
public static string AddASite {
get {
return ResourceManager.GetString("AddASite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add Folder.
/// </summary>
@ -178,6 +187,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to The easiest way to add new sites to your vault is from the bitwarden App Extension. Learn more about using the bitwarden App Extension by navigating to the &quot;Tools&quot; screen..
/// </summary>
public static string BitwardenAppExtensionAlert {
get {
return ResourceManager.GetString("BitwardenAppExtensionAlert", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use bitwarden in Safari and other apps to auto-fill your logins..
/// </summary>
@ -358,6 +376,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Edit Site.
/// </summary>
public static string EditSite {
get {
return ResourceManager.GetString("EditSite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Email.
/// </summary>
@ -394,6 +421,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Enable Automatic Syncing.
/// </summary>
public static string EnableAutomaticSyncing {
get {
return ResourceManager.GetString("EnableAutomaticSyncing", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Enter your PIN code..
/// </summary>
@ -484,6 +520,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Favorite.
/// </summary>
public static string Favorite {
get {
return ResourceManager.GetString("Favorite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Favorites.
/// </summary>
@ -889,6 +934,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to New site created..
/// </summary>
public static string NewSiteCreated {
get {
return ResourceManager.GetString("NewSiteCreated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No.
/// </summary>
@ -898,6 +952,24 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to There are no favorites in your vault..
/// </summary>
public static string NoFavorites {
get {
return ResourceManager.GetString("NoFavorites", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to There are no sites in your vault..
/// </summary>
public static string NoSites {
get {
return ResourceManager.GetString("NoSites", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Notes.
/// </summary>
@ -916,6 +988,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Ok, got it!.
/// </summary>
public static string OkGotIt {
get {
return ResourceManager.GetString("OkGotIt", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Options.
/// </summary>
@ -943,6 +1024,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Password generated..
/// </summary>
public static string PasswordGenerated {
get {
return ResourceManager.GetString("PasswordGenerated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Password Generator.
/// </summary>
@ -961,6 +1051,24 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to overwrite the current password?.
/// </summary>
public static string PasswordOverrideAlert {
get {
return ResourceManager.GetString("PasswordOverrideAlert", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to bitwarden keeps your vault automatically synced by using push notifications. For the best possible experience, please select \&quot;Ok\&quot; on the following prompt when asked to enable push notifications..
/// </summary>
public static string PushNotificationAlert {
get {
return ResourceManager.GetString("PushNotificationAlert", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rate the App.
/// </summary>
@ -1015,6 +1123,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Search vault.
/// </summary>
public static string SearchVault {
get {
return ResourceManager.GetString("SearchVault", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Security.
/// </summary>
@ -1087,6 +1204,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Site Information.
/// </summary>
public static string SiteInformation {
get {
return ResourceManager.GetString("SiteInformation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No Name.
/// </summary>
@ -1096,6 +1222,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Site updated..
/// </summary>
public static string SiteUpdated {
get {
return ResourceManager.GetString("SiteUpdated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Submit.
/// </summary>
@ -1303,6 +1438,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to View Site.
/// </summary>
public static string ViewSite {
get {
return ResourceManager.GetString("ViewSite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Visit Our Website.
/// </summary>

View file

@ -394,6 +394,9 @@
<data name="Account" xml:space="preserve">
<value>Account</value>
</data>
<data name="AddASite" xml:space="preserve">
<value>Add a Site</value>
</data>
<data name="AppExtension" xml:space="preserve">
<value>App Extension</value>
</data>
@ -409,6 +412,9 @@
<data name="BitwardenAppExtension" xml:space="preserve">
<value>bitwarden App Extension</value>
</data>
<data name="BitwardenAppExtensionAlert" xml:space="preserve">
<value>The easiest way to add new sites to your vault is from the bitwarden App Extension. Learn more about using the bitwarden App Extension by navigating to the "Tools" screen.</value>
</data>
<data name="BitwardenAppExtensionDescription" xml:space="preserve">
<value>Use bitwarden in Safari and other apps to auto-fill your logins.</value>
</data>
@ -439,6 +445,12 @@
<data name="CurrentSession" xml:space="preserve">
<value>Current Session</value>
</data>
<data name="EditSite" xml:space="preserve">
<value>Edit Site</value>
</data>
<data name="EnableAutomaticSyncing" xml:space="preserve">
<value>Enable Automatic Syncing</value>
</data>
<data name="ExntesionReenable" xml:space="preserve">
<value>Re-enable App Extension</value>
</data>
@ -467,6 +479,9 @@
<data name="ExtensionTurnOn" xml:space="preserve">
<value>To turn on bitwarden in Safari and other apps, tap the "more" icon on the bottom row of the menu.</value>
</data>
<data name="Favorite" xml:space="preserve">
<value>Favorite</value>
</data>
<data name="Fingerprint" xml:space="preserve">
<value>Fingerprint</value>
</data>
@ -526,18 +541,41 @@
<data name="Never" xml:space="preserve">
<value>Never</value>
</data>
<data name="NewSiteCreated" xml:space="preserve">
<value>New site created.</value>
</data>
<data name="NoFavorites" xml:space="preserve">
<value>There are no favorites in your vault.</value>
</data>
<data name="NoSites" xml:space="preserve">
<value>There are no sites in your vault.</value>
</data>
<data name="OkGotIt" xml:space="preserve">
<value>Ok, got it!</value>
<comment>Confirmation, like "Ok, I understand it"</comment>
</data>
<data name="Options" xml:space="preserve">
<value>Options</value>
</data>
<data name="Other" xml:space="preserve">
<value>Other</value>
</data>
<data name="PasswordGenerated" xml:space="preserve">
<value>Password generated.</value>
</data>
<data name="PasswordGenerator" xml:space="preserve">
<value>Password Generator</value>
</data>
<data name="PasswordGeneratorDescription" xml:space="preserve">
<value>Automatically generate strong, unique passwords for your logins.</value>
</data>
<data name="PasswordOverrideAlert" xml:space="preserve">
<value>Are you sure you want to overwrite the current password?</value>
</data>
<data name="PushNotificationAlert" xml:space="preserve">
<value>bitwarden keeps your vault automatically synced by using push notifications. For the best possible experience, please select \"Ok\" on the following prompt when asked to enable push notifications.</value>
<comment>Push notifications for apple products</comment>
</data>
<data name="RateTheApp" xml:space="preserve">
<value>Rate the App</value>
</data>
@ -550,6 +588,9 @@
<data name="RegeneratePassword" xml:space="preserve">
<value>Regenerate Password</value>
</data>
<data name="SearchVault" xml:space="preserve">
<value>Search vault</value>
</data>
<data name="Security" xml:space="preserve">
<value>Security</value>
</data>
@ -565,6 +606,12 @@
<data name="SetPINDirection" xml:space="preserve">
<value>Enter a 4 digit PIN code to unlock the app with.</value>
</data>
<data name="SiteInformation" xml:space="preserve">
<value>Site Information</value>
</data>
<data name="SiteUpdated" xml:space="preserve">
<value>Site updated.</value>
</data>
<data name="Syncing" xml:space="preserve">
<value>Syncing...</value>
<comment>Message shown when interacting with the server</comment>
@ -594,6 +641,9 @@
<data name="UnlockWithPIN" xml:space="preserve">
<value>Unlock with PIN Code</value>
</data>
<data name="ViewSite" xml:space="preserve">
<value>View Site</value>
</data>
<data name="WebVault" xml:space="preserve">
<value>bitwarden Web Vault</value>
</data>