মডিউল:ট্র্যাক তালিকায়ন: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
সম্পাদনা সারাংশ নেই
Johnuniq (আলোচনা | অবদান)
this should do what is requested on talk but needs testing!
২০ নং লাইন:
end
end
end
 
-- অনুবাদে কোন পরিবর্তন হলে এখানে করুন
-- যদি ক্ষেত্রের জন্য বেশ কিছু bangla পরামিতি থাকে, তাহলে Lua টেবিল থেকে একটি স্ট্রিং প্রতিস্থাপন করুন
local fieldTranslations = {
-- Track.fields
['নম্বর'] = 'number',
['শিরোনাম'] = 'title',
['টীকা'] = 'note',
['দৈর্ঘ্য'] = 'length',
['কথা'] = 'lyrics',
['সঙ্গীত'] = 'music',
['লেখক'] = 'writer',
['অতিরিক্ত'] = 'extra',
 
-- TrackListing.fields
['نویسنده_همه'] = 'all_writing',
['سراینده_همه'] = 'all_lyrics',
['آهنگساز_همه'] = 'all_music',
['جمع‌شونده'] = 'collapsed',
['عنوان'] = 'headline',
['ستون_اضافی'] = 'extra_column',
['مدت_کل'] = 'total_length',
['پهنای_نام'] = 'title_width',
['پهنای_نویسنده'] = 'writing_width',
['پهنای_سراینده'] = 'lyrics_width',
['پهنای_آهنگساز'] = 'music_width',
['پهنای_اضافی'] = 'extra_width',
['رده'] = 'category',
 
-- TrackListing.deprecatedFields
['شرکت‌کنندگان_نویسندگی'] = 'writing_credits',
['شرکت‌کنندگان_سرودن'] = 'lyrics_credits',
['شرکت‌کنندگان_آهنگسازی'] = 'music_credits',
 
local function translateFields(param)
return fieldTranslations[param] or param
end
 
৫৯ ⟶ ৯৭ নং লাইন:
end
 
local enLength = convert('en', length)
local hours, minutes, seconds
 
-- Try to match times like "1:23:45".
hours, minutes, seconds = convert('en',length)enLength:match('^(%d+):(%d%d):(%d%d)$')
if hours and convert('en',hours):sub(1, 1) == '0' then
-- Disallow times like "0:12:34"
self:addWarning(string.format(
৭৪ ⟶ ১১৩ নং লাইন:
if not seconds then
-- The previous attempt didn't match. Try to match times like "1:23".
minutes, seconds = convert('en',length)enLength:match('^(%d?%d):(%d%d)$')
if minutes and convert('en',minutes):find('^0%d$') then
-- Special case to disallow lengths like "01:23". This check has to
-- be here so that lengths like "1:01:23" are still allowed.
৯৬ ⟶ ১৩৫ নং লাইন:
 
-- Check that the minutes are less than 60 if we have an hours field.
if hours and convert('en',tonumber(minutes)) >= 60 then
self:addWarning(string.format(
"অবৈধ ট্র্যাকের দৈর্ঘ্য '%s' (যদি ঘণ্টা নির্দিষ্ট করা হয়, তবে মিনিটের মান ৬০-এর কম হতে হবে)",
১০৫ ⟶ ১৪৪ নং লাইন:
 
-- Check that the seconds are less than 60
if convert('en',tonumber(seconds)) >= 60 then
self:addWarning(string.format(
"অবৈধ ট্র্যাকের দৈর্ঘ্য '%s' (সেকেন্ডের মান ৬০-এর কম হতে হবে)",
১৩২ ⟶ ১৭১ নং লাইন:
writer = true,
extra = true,
 
-- অনুবাদে কোন পরিবর্তন হলে এখানে করুন
-- যদি ক্ষেত্রের জন্য বেশ কিছু bangla পরামিতি থাকে, তাহলে Lua টেবিল থেকে একটি স্ট্রিং প্রতিস্থাপন করুন
local fieldTranslations = {
-- Track.fields
number = 'নম্বর',
title = 'শিরোনাম',
note = 'টীকা',
length = 'দৈর্ঘ্য',
lyrics = 'কথা',
music = 'সঙ্গীত',
writer = 'লেখক',
extra = 'অতিরিক্ত',
 
-- TrackListing.fields
all_writing = 'نویسنده_همه',
all_lyrics = 'سراینده_همه',
all_music = 'آهنگساز_همه',
collapsed = 'جمع‌شونده',
headline = 'عنوان',
extra_column = 'ستون_اضافی',
total_length = 'مدت_کل',
title_width = 'پهنای_نام',
writing_width = 'پهنای_نویسنده',
lyrics_width = 'پهنای_سراینده',
music_width = 'پهنای_آهنگساز',
extra_width = 'پهنای_اضافی',
category = 'رده',
 
-- TrackListing.deprecatedFields
writing_credits = 'شرکت‌کنندگان_نویسندگی',
lyrics_credits = 'شرکت‌کنندگان_سرودن',
music_credits = 'شرکت‌کنندگان_آهنگسازی',
}
 
৩০২ ⟶ ৩০৭ নং লাইন:
music_credits = true,
}
 
local function translateFields(param)
if param ~= nil then
if string.find(param, '^[a-zA-Z _]+$') then
return param
end
 
for k,v in pairs(fieldTranslations) do
if type(v) == 'table' then
for _,vv in v do
if vv == param then
return k
end
end
elseif v == param then
return k
end
end
end
 
return param
end
 
function TrackListing.new(data)
৬৪৯ ⟶ ৬৩২ নং লাইন:
tracks[num][prefix] = v
else
data[translateFields(k)] = convert('en', v, true, true)
end
end