Line 1,661: |
Line 1,661: |
| | | |
| local function get_display_names (max, count, list_name, etal) | | local function get_display_names (max, count, list_name, etal) |
− | local border = 1;
| + | if is_set (max) then |
− | if is_set (border) then | + | if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings |
− | if 'etal' == border:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings | + | max = count + 1; -- number of authors + 1 so display all author name plus et al. |
− | border = count + 1; -- number of authors + 1 so display all author name plus et al. | |
| etal = true; -- overrides value set by extract_names() | | etal = true; -- overrides value set by extract_names() |
− | elseif border:match ('^%d+$') then -- if is a string of numbers | + | elseif max:match ('^%d+$') then -- if is a string of numbers |
− | border = tonumber (max); -- make it a number | + | max = tonumber (max); -- make it a number |
− | if border >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors | + | if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors |
| add_maint_cat ('disp_name', cfg.special_case_translation [list_name]); | | add_maint_cat ('disp_name', cfg.special_case_translation [list_name]); |
| end | | end |
| else -- not a valid keyword or number | | else -- not a valid keyword or number |
− | table.insert( z.message_tail, { set_error( 'invalid_param_val', {'display-' .. list_name, border}, true ) } ); -- add error message | + | table.insert( z.message_tail, { set_error( 'invalid_param_val', {'display-' .. list_name, max}, true ) } ); -- add error message |
− | border = nil; -- unset; as if |display-xxxxors= had not been set | + | max = nil; -- unset; as if |display-xxxxors= had not been set |
| end | | end |
| end | | end |
− | | + | if count > 1 then |
− | return border, etal; | + | etal = true; |
| + | else |
| + | etal = false; |
| + | end |
| + | return 1, etal; |
| end | | end |
| | | |