mirror of
https://github.com/grocy/grocy.git
synced 2025-10-12 16:44:55 +00:00
Added localization support
This commit is contained in:
@@ -6,11 +6,12 @@ Grocy.Components.BatteryCard.Refresh = function(batteryId)
|
||||
function(batteryDetails)
|
||||
{
|
||||
$('#batterycard-battery-name').text(batteryDetails.battery.name);
|
||||
$('#batterycard-battery-used_in').text(batteryDetails.battery.used_in);
|
||||
$('#batterycard-battery-last-charged').text((batteryDetails.last_charged || 'never'));
|
||||
$('#batterycard-battery-last-charged-timeago').text($.timeago(batteryDetails.last_charged || ''));
|
||||
$('#batterycard-battery-charge-cycles-count').text((batteryDetails.charge_cycles_count || '0'));
|
||||
|
||||
EmptyElementWhenMatches('#batterycard-battery-last-charged-timeago', 'NaN years ago');
|
||||
EmptyElementWhenMatches('#batterycard-battery-last-charged-timeago', L('timeago_nan'));
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
|
@@ -9,11 +9,12 @@ $(function()
|
||||
calendarWeeks: true,
|
||||
orientation: 'bottom auto',
|
||||
weekStart: 1,
|
||||
showOnFocus: false
|
||||
showOnFocus: false,
|
||||
language: L('bootstrap_datepicker_locale')
|
||||
});
|
||||
$('.datepicker').trigger('change');
|
||||
|
||||
EmptyElementWhenMatches('#datepicker-timeago', 'NaN years ago');
|
||||
EmptyElementWhenMatches('#datepicker-timeago', L('timeago_nan'));
|
||||
});
|
||||
|
||||
$('.datepicker').on('keydown', function(e)
|
||||
@@ -82,7 +83,7 @@ $('.datepicker').on('change', function(e)
|
||||
}
|
||||
|
||||
$('#datepicker-timeago').text($.timeago($('.datepicker').val()));
|
||||
EmptyElementWhenMatches('#datepicker-timeago', 'NaN years ago');
|
||||
EmptyElementWhenMatches('#datepicker-timeago', L('timeago_nan'));
|
||||
});
|
||||
|
||||
$('#datepicker-button').on('click', function(e)
|
||||
|
@@ -5,6 +5,7 @@ $(function()
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
showTodayButton: true,
|
||||
calendarWeeks: true,
|
||||
maxDate: moment()
|
||||
maxDate: moment(),
|
||||
locale: moment.locale('de')
|
||||
});
|
||||
});
|
||||
|
@@ -10,7 +10,7 @@ Grocy.Components.HabitCard.Refresh = function (habitId)
|
||||
$('#habitcard-habit-last-tracked-timeago').text($.timeago(habitDetails.last_tracked || ''));
|
||||
$('#habitcard-habit-tracked-count').text((habitDetails.tracked_count || '0'));
|
||||
|
||||
EmptyElementWhenMatches('#habitcard-habit-last-tracked-timeago', 'NaN years ago');
|
||||
EmptyElementWhenMatches('#habitcard-habit-last-tracked-timeago', L('timeago_nan'));
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
|
@@ -9,13 +9,13 @@ Grocy.Components.ProductCard.Refresh = function(productId)
|
||||
$('#productcard-product-stock-amount').text(productDetails.stock_amount || '0');
|
||||
$('#productcard-product-stock-qu-name').text(productDetails.quantity_unit_stock.name);
|
||||
$('#productcard-product-stock-qu-name2').text(productDetails.quantity_unit_stock.name);
|
||||
$('#productcard-product-last-purchased').text((productDetails.last_purchased || 'never').substring(0, 10));
|
||||
$('#productcard-product-last-purchased').text((productDetails.last_purchased || L('never')).substring(0, 10));
|
||||
$('#productcard-product-last-purchased-timeago').text($.timeago(productDetails.last_purchased || ''));
|
||||
$('#productcard-product-last-used').text((productDetails.last_used || 'never').substring(0, 10));
|
||||
$('#productcard-product-last-used').text((productDetails.last_used || L('never')).substring(0, 10));
|
||||
$('#productcard-product-last-used-timeago').text($.timeago(productDetails.last_used || ''));
|
||||
|
||||
EmptyElementWhenMatches('#productcard-product-last-purchased-timeago', 'NaN years ago');
|
||||
EmptyElementWhenMatches('#productcard-product-last-used-timeago', 'NaN years ago');
|
||||
EmptyElementWhenMatches('#productcard-product-last-purchased-timeago', L('timeago_nan'));
|
||||
EmptyElementWhenMatches('#productcard-product-last-used-timeago', L('timeago_nan'));
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
|
Reference in New Issue
Block a user