وحدة:بطاقة/قالب/وحدة قياس

من ويكيبيديا، الموسوعة الحرة

local generic = require( 'وحدة:بطاقة/أدوات' )

function FormatNumVal(value) 
if(tonumber(value) and math.abs(tonumber(value))<0.00001) then return string.format("%5.3E",value); end
return value;
end;

return  {
    maincolor = '#E1E1E1',
	wikimod = 'Wikidata.Ca',
    parts = {
		generic.title(),
		generic.mainimage(),
        {type = 'table', title = 'معلومات عامة', rows = {
                {type = 'row' , label = 'النوع'
                        , value = {'نوع','type'}
                        ,  wikidata= {property = 'P31'}
                },
                {type = 'row' , label = 'لديه جزء', plurallabel='لديه أجزاء'
                        , value = {'جزء','has_parts'}
                        ,  wikidata= {property = 'P527', qualifier='P1114'
                        	, formatting='table', rowformat='$0$R0 $1'
                        	, rowsubformat1='<small><br />العدد :$1</small>'}
                },
                {type = 'row' , label = 'جزء من'
                        , value = {'جزء من'}
                        ,  wikidata= {property = 'P361'}
                },
                {type = 'row' , label = 'تستخدم لقياس'
                        ,value = {'لقياس'}
                        ,  wikidata= {property = 'P111'}
                },
                {type = 'row' , label = 'سميت باسم'
                        ,value = {'سميت باسم'}
                        ,  wikidata= {property = 'P138'}
                },
                {type = 'row' , label = 'رمز الوحدة'
                        ,value = {'الرمز'}
                        ,  wikidata= {property = 'P5061'
                        	, formatting = '* $text {{Language icon|NoCat=y|$language}}' 
                        	, conjunction='LF'}
                },
                {type = 'row' , label = 'رمز يونيكود'
                        , value = {'رمز يونيكود'}
                        , wikidata= {property = 'P487'}
                },
		}},
		{type='table', title = 'تحويلات الوحدة', rows = {
                {type = 'row' , label = 'إلى النظام الدولي'
                        ,value = {'تحويل إلى النظام الدولي'}
                        ,  wikidata= {property = 'P2370', before ='*',conjunction="\n*", formatting='unit'
                                     , case=FormatNumVal
                        }
                },
                {type = 'row' , label = '[[نظام وحدات سنتيمتر غرام ثانية|نظام وحدات سي جي إس]]'
                        ,value = {'سي جي إس'}
                },
                {type = 'row' , label = 'الوحدة القياسية'
                        , value = {'الوحدة القياسية المكافئة'}
                        ,  wikidata= {property = 'P2442', 
                        	before ='*',conjunction="\n*", 
                        	formatting='unit' ,
                            case=FormatNumVal
                        }
                },
        }},
    }  -- for parts
} -- for return