Get tool tip for Poll status.

@param pollStatus
@param i18N
@return PollStatusToolTip
164292
public static String getPollStatusToolTip(final PollStatus pollStatus, final VaadinMessageSource i18N) {
        if (pollStatus != null && pollStatus.getLastPollDate() != null && pollStatus.isOverdue()) {
            final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
            return i18N.getMessage(UIMessageIdProvider.TOOLTIP_OVERDUE, SPDateTimeUtil.getDurationFormattedString(
                    pollStatus.getOverdueDate().atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant().toEpochMilli(),
                    pollStatus.getCurrentDate().atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant().toEpochMilli(),
                    i18N));
        }
        return null;
    }
1104731
def get_locale_hints():
        
        #/
        lang, encoding = locale.getdefaultlocale()
        ## can both be None
        
        #/
        if lang and '_' in lang:
            lang3, _, lang2 = lang.partition('_')
        else:
            lang3 = None
            lang2 = None
        
        #/
        ll_s = [encoding, lang, lang2, lang3]
        ## Encoding comes before lang intentionally, e.g.
        ##  lang |en_US| with encoding |cp936|, |cp936| takes priority.
        
        #/
        ll_s_unique = []
        
        for ll in ll_s:
            if ll:
                ll = ll.lower()
                
                if ll not in ll_s_unique:
                    ll_s_unique.append(ll)
        
        #/
        return ll_s_unique
653056
function localizeStrict( i18nValue, optionalFallbackValue, languageTag = tags[ locale ] ) {
         if( !i18nValue || primitives[ typeof i18nValue ] ) {
            // value is not internationalized
            return i18nValue;
         }
         if( !languageTag ) {
            return optionalFallbackValue;
         }

         // Try one direct lookup before scanning the input keys,
         // assuming that language-tags are written in consistent style.
         const value = i18nValue[ languageTag ];
         if( value !== undefined ) {
            return value;
         }

         const lookupKey = normalize( languageTag );
         const availableTags = Object.keys( i18nValue );
         const n = availableTags.length;
         for( let i = 0; i < n; ++i ) {
            const t = availableTags[ i ];
            if( normalize( t ) === lookupKey ) {
               return i18nValue[ t ];
            }
         }

         return optionalFallbackValue;
      }
55775
protected SortedMap<String, String> getProperties(ITextNode[]nodes, String language, Status[] status) {
    TreeMap<String, String> map = new TreeMap<>();
    for (ITextNode node : nodes) {
      IValueNode valueNode = node.getValueNode(language);
      if (valueNode != null) {
        if (status == null || TremaCoreUtil.containsStatus(valueNode.getStatus(), status)) {
          IKeyValuePair keyValuePair = new KeyValuePair(node.getKey(), valueNode.getValue());
          if (iExportFilters != null) {
            for (IExportFilter filter : iExportFilters) {
              filter.filter(keyValuePair);
            }
          }
          map.put(keyValuePair.getKey(), keyValuePair.getValue());
        }
      }
    }
    return map;
  }
538436
def status_report_header(format = StatusCat::Checkers::Base::FORMAT)
      name = I18n.t(:name, scope: :status_cat)
      value = I18n.t(:value, scope: :status_cat)
      status = I18n.t(:status, scope: :status_cat)
      return format(format, name, value, status)
    end
339080
@Command(name = "DevPollStatus", inTypeDesc = DEVICE_NAME, outTypeDesc = "Device polling status")
    public String[] getPollStatus(final String deviceName) throws DevFailed {
        xlogger.entry(deviceName);

        String[] ret = new PollStatusCommand(deviceName, classList).call();
        xlogger.exit(ret);
        return ret;
    }
708985
protected void updateTooltip()
	{
		if (slot.getItemStack().isEmpty())
		{
			tooltip = defaultTooltip;
			return;
		}

		List<String> lines = slot	.getItemStack()
									.getTooltip(Utils.getClientPlayer(),
												Minecraft.getMinecraft().gameSettings.advancedItemTooltips	? ITooltipFlag.TooltipFlags.ADVANCED
																											: ITooltipFlag.TooltipFlags.NORMAL);

		String text = lines.stream().collect(Collectors.joining(TextFormatting.RESET + "\n" + TextFormatting.GRAY));
		//		lines.set(0, slot.getItemStack().getRarity().rarityColor + lines.get(0));
		//		for (int i = 1; i < lines.size(); i++)
		//			lines.set(i, TextFormatting.GRAY + lines.get(i));

		tooltip = new UITooltip(slot.getItemStack().getRarity().rarityColor + text);
	}
1201406
function scrollSyncExtension(editor) {
  const className = 'tui-scrollsync';
  const i18n = editor.i18n;
  const TOOL_TIP = {
    active: i18n.get('Auto scroll enabled'),
    inactive: i18n.get('Auto scroll disabled')
  };

  if (editor.isViewer()) {
    return;
  }

  const cm = editor.getCodeMirror();
  const sectionManager = new SectionManager(cm, editor.preview);
  const scrollManager = new ScrollManager(sectionManager, cm, editor.preview.$el);

  let isScrollable = false;
  let isActive = true;
  let button;
  let $divider;

  // UI
  if (editor.getUI().name === 'default') {
    const toolbar = editor.getUI().getToolbar();

    toolbar.addItem('divider');
    toolbar.addItem({
      type: 'button',
      options: {
        className,
        command: 'scrollSyncToggle',
        tooltip: TOOL_TIP.active,
        $el: $(`<button class="active ${className}" type="button"></button>`)
      }
    });
    const items = toolbar.getItems();
    $divider = items[items.length - 2].$el;
    button = items[items.length - 1];

    changeButtonVisiblityStateIfNeed();
    // hide scroll follow button in wysiwyg
    editor.on('changeMode', changeButtonVisiblityStateIfNeed);
    editor.on('changePreviewStyle', changeButtonVisiblityStateIfNeed);

    // Commands
    editor.addCommand('markdown', {
      name: 'scrollSyncToggle',
      exec() {
        isActive = !isActive;
        button._onOut();
        if (isActive) {
          button.$el.addClass('active');
          button.setTooltip(TOOL_TIP.active);
        } else {
          button.$el.removeClass('active');
          button.setTooltip(TOOL_TIP.inactive);
        }
        button._onOver();
      }
    });
  }

  // Events
  cm.on('change', () => {
    isScrollable = false;
    sectionManager.makeSectionList();
  });

  /**
   * change button visiblity state
   */
  function changeButtonVisiblityStateIfNeed() {
    if (editor.mdPreviewStyle === 'vertical' && editor.currentMode === 'markdown') {
      button.$el.show();
      $divider.show();
    } else {
      button.$el.hide();
      $divider.hide();
    }
  }

  editor.on('previewRenderAfter', () => {
    sectionManager.sectionMatch();
    if (isActive) {
      scrollManager.syncPreviewScrollTopToMarkdown();
    }
    isScrollable = true;
  });

  editor.eventManager.listen('scroll', event => {
    if (!isActive) {
      return;
    }

    if (isScrollable && editor.preview.isVisible()) {
      if (event.source === 'markdown' && !scrollManager.isMarkdownScrollEventBlocked) {
        scrollManager.syncPreviewScrollTopToMarkdown();
      } else if (event.source === 'preview' && !scrollManager.isPreviewScrollEventBlocked) {
        scrollManager.syncMarkdownScrollTopToPreview();
      }
    } else {
      scrollManager.saveScrollInfo();
    }
  });
}
399131
private PopupFindMenu getPopupMenuFind() {
        if (popupFindMenu== null) {
            popupFindMenu = new PopupFindMenu();
            popupFindMenu.setText(Constant.messages.getString("edit.find.popup"));	// ZAP: i18n
            popupFindMenu.addActionListener(new java.awt.event.ActionListener() {
                @Override
                public void actionPerformed(java.awt.event.ActionEvent e) {
                    JTextComponent component = popupFindMenu.getLastInvoker();
                    Window window = getWindowAncestor(component);
                    if (window != null) {
                        showFindDialog(window, component);
                    }
                }
            });
        }
        return popupFindMenu;
    }
446701
public static String getText(String code, Object[] args, Locale locale) {
        Preconditions.checkState(messageSource != null,
                "If i18n is enabled, please make sure MessageSource is properly set as a member in "
                        + "MessageSupport");
        return messageSource.getMessage(code, args, locale);
    }
296895
public List<String> getI18nkeys() {
    	if (i18nkeys == null) {
    		return new ArrayList<String>();
    	}
    	Collections.sort(i18nkeys, new Comparator<String>() {

			@Override
			public int compare(String o1, String o2) {				
				return Collator.getInstance().compare(o1, o2);
			}
		});
		return i18nkeys;
	}
380834
public String getTooltip() {
        final String key = "pm.field." + getEntity().getId() + "." + getId() + ".tooltip";
        if (key == null) {
            return null;
        }
        final String message = getPm().message(key);
        if (key.equals(message)) {
            return null;
        }
        return message;
    }
376413
protected String getI18n(final String aMessageKey, final int aIntDetail) {
        return StringUtils.normalizeWS(myBundle.get(aMessageKey, Integer.toString(aIntDetail)));
    }
432590
public synchronized boolean completedTask(TaskInProgress tip,
                                            TaskStatus status)
  {
    TaskAttemptID taskid = status.getTaskID();
    int oldNumAttempts = tip.getActiveTasks().size();
    final JobTrackerInstrumentation metrics = jobtracker.getInstrumentation();

    // Metering
    meterTaskAttempt(tip, status);

    // Sanity check: is the TIP already complete?
    // It _is_ safe to not decrement running{Map|Reduce}Tasks and
    // finished{Map|Reduce}Tasks variables here because one and only
    // one task-attempt of a TIP gets to completedTask. This is because
    // the TaskCommitThread in the JobTracker marks other, completed,
    // speculative tasks as _complete_.
    if (tip.isComplete()) {
      // Mark this task as KILLED
      tip.alreadyCompletedTask(taskid);

      // Let the JobTracker cleanup this taskid if the job isn't running
      if (this.status.getRunState() != JobStatus.RUNNING) {
        jobtracker.markCompletedTaskAttempt(status.getTaskTracker(), taskid);
      }
      return false;
    }


    LOG.info("Task '" + taskid + "' has completed " + tip.getTIPId() +
             " successfully.");

    // Mark the TIP as complete
    tip.completed(taskid);
    resourceEstimator.updateWithCompletedTask(status, tip);

    // Update jobhistory
    TaskTrackerStatus ttStatus =
      this.jobtracker.getTaskTrackerStatus(status.getTaskTracker());
    String trackerHostname = jobtracker.getNode(ttStatus.getHost()).toString();
    String taskType = getTaskType(tip);
    if (status.getIsMap()){
      JobHistory.MapAttempt.logStarted(status.getTaskID(), status.getStartTime(),
                                       status.getTaskTracker(),
                                       ttStatus.getHttpPort(),
                                       taskType);
      JobHistory.MapAttempt.logFinished(status.getTaskID(), status.getFinishTime(),
                                        trackerHostname, taskType,
                                        status.getStateString(),
                                        status.getCounters());
    }else{
      JobHistory.ReduceAttempt.logStarted( status.getTaskID(), status.getStartTime(),
                                          status.getTaskTracker(),
                                          ttStatus.getHttpPort(),
                                          taskType);
      JobHistory.ReduceAttempt.logFinished(status.getTaskID(), status.getShuffleFinishTime(),
                                           status.getSortFinishTime(), status.getFinishTime(),
                                           trackerHostname,
                                           taskType,
                                           status.getStateString(),
                                           status.getCounters());
    }
    JobHistory.Task.logFinished(tip.getTIPId(),
                                taskType,
                                tip.getExecFinishTime(),
                                status.getCounters());

    int newNumAttempts = tip.getActiveTasks().size();
    if (tip.isJobSetupTask()) {
      // setup task has finished. kill the extra setup tip
      killSetupTip(!tip.isMapTask());
      setupComplete();
    } else if (tip.isJobCleanupTask()) {
      // cleanup task has finished. Kill the extra cleanup tip
      if (tip.isMapTask()) {
        // kill the reduce tip
        cleanup[1].kill();
      } else {
        cleanup[0].kill();
      }

      //
      // The Job is done
      // if the job is failed, then mark the job failed.
      if (jobFailed) {
        terminateJob(JobStatus.FAILED);
      }
      // if the job is killed, then mark the job killed.
      if (jobKilled) {
        terminateJob(JobStatus.KILLED);
      }
      else {
        jobComplete();
      }
      // The job has been killed/failed/successful
      // JobTracker should cleanup this task
      jobtracker.markCompletedTaskAttempt(status.getTaskTracker(), taskid);
    } else if (tip.isMapTask()) {
      // check if this was a sepculative task
      if (oldNumAttempts > 1) {
        speculativeMapTasks -= (oldNumAttempts - newNumAttempts);
        if (!garbageCollected) {
          totalSpeculativeMapTasks.addAndGet(newNumAttempts - oldNumAttempts);
        }
      }
      if (tip.isSpeculativeAttempt(taskid)) {
        metrics.speculativeSucceededMap(taskid,
            tip.isUsingProcessingRateForSpeculation());
      }
      int level = getLocalityLevel(tip, ttStatus);
      long inputBytes = tip.getCounters()
                .getGroup("org.apache.hadoop.mapred.Task$Counter")
                .getCounter("Map input bytes");
      switch (level) {
      case 0: jobCounters.incrCounter(Counter.LOCAL_MAP_INPUT_BYTES,
                inputBytes);
              metrics.addLocalMapInputBytes(inputBytes);
              break;
      case 1: jobCounters.incrCounter(Counter.RACK_MAP_INPUT_BYTES,
                inputBytes);
              metrics.addRackMapInputBytes(inputBytes);
              break;
      default:metrics.addMapInputBytes(inputBytes);
              break;
      }
      finishedMapTasks += 1;
      metrics.completeMap(taskid);
      if (!garbageCollected) {
        if (!tip.isJobSetupTask() && hasSpeculativeMaps) {
          updateTaskTrackerStats(tip,ttStatus,trackerMapStats,mapTaskStats);
        }
      }
      // remove the completed map from the resp running caches
      retireMap(tip);
      if ((finishedMapTasks + failedMapTIPs) == (numMapTasks)) {
        this.status.setMapProgress(1.0f);
      }
    } else {
      if (oldNumAttempts > 1) {
        speculativeReduceTasks -= (oldNumAttempts - newNumAttempts);
        if (!garbageCollected) {
          totalSpeculativeReduceTasks.addAndGet(newNumAttempts - oldNumAttempts);
        }
      }
      if (tip.isSpeculativeAttempt(taskid)) {
        metrics.speculativeSucceededReduce(taskid,
            tip.isUsingProcessingRateForSpeculation());
      }
      finishedReduceTasks += 1;
      metrics.completeReduce(taskid);
      if (!garbageCollected) {
        if (!tip.isJobSetupTask() && hasSpeculativeReduces) {
          updateTaskTrackerStats(tip,ttStatus,trackerReduceStats,reduceTaskStats);
        }
      }
      // remove the completed reduces from the running reducers set
      retireReduce(tip);
      if ((finishedReduceTasks + failedReduceTIPs) == (numReduceTasks)) {
        this.status.setReduceProgress(1.0f);
      }
    }

    // is job complete?
    if (!jobSetupCleanupNeeded && canLaunchJobCleanupTask()) {
      jobComplete();
    }

    return true;
  }
635368
protected MatchedLocale getBestMatch(Map<String,Locale> supportedLocales, String acceptLanguage) {
		// Parse into language, country, and variant
		String language;
		String country;
		String variant;
		int pos1 = acceptLanguage.indexOf('-');
		if(pos1 == -1) {
			language = acceptLanguage;
			country = "";
			variant = "";
		} else {
			language = acceptLanguage.substring(0, pos1);
			int pos2 = acceptLanguage.indexOf('-', pos1 + 1);
			if(pos2 == -1) {
				country = acceptLanguage.substring(pos1 + 1);
				variant = "";
			} else {
				country = acceptLanguage.substring(pos1 + 1, pos2);
				variant = acceptLanguage.substring(pos2 + 1);
			}
		}
		if(!language.isEmpty()) {
			language = language.toLowerCase(Locale.ROOT);
			if(!country.isEmpty()) {
				country = country.toUpperCase(Locale.ROOT);
				if(!variant.isEmpty()) {
					// Exact match on language, country, and variant
					Locale match = supportedLocales.get(
						toLocaleString(
							new Locale(language, country, variant)
						)
					);
					if(match != null) {
						return new MatchedLocale(
							match,
							true
						);
					}
				}
				// Match on language and country
				Locale match = supportedLocales.get(
					toLocaleString(
						new Locale(language, country)
					)
				);
				if(match != null) {
					return new MatchedLocale(
						match,
						variant.isEmpty()
					);
				}
			}
			// Match language
			Locale match = supportedLocales.get(
				toLocaleString(
					new Locale(language)
				)
			);
			if(match != null) {
				return new MatchedLocale(
					match,
					country.isEmpty() && variant.isEmpty()
				);
			}
		}
		// No match
		return null;
	}
506279
public void setTooltip(final String tooltip) {
		String escapedXMLContent = this.xmlUtil.escapeXMLContent(tooltip);
		if (escapedXMLContent.contains("\n")) {
			escapedXMLContent = escapedXMLContent.replaceAll("\r?\n", "</text:p><text:p>");
		}

		this.tooltip = escapedXMLContent;
	}
479559
private void showTooltip() {
    Wrap tooltipLabel = new Wrap(toolTipWrapWidth);
    tooltipLabel.setForeground(getForeground());
    tooltipLabel.setFont(ToolTipButton.this.getFont());
    tooltipLabel.setText(text);

    JPanel panel = new JPanel();
    panel.setBackground(toolTipBackground);
    panel.setLayout(new BorderLayout());
    panel.add(tooltipLabel, BorderLayout.CENTER);


    if (extraComponent != null && extraComponentAnchor != null) {
      if (extraComponentAnchor.equals(ToolTipButtonAnchor.SOUTH)) {
        panel.add(extraComponent, BorderLayout.SOUTH);
      }
      else if (extraComponentAnchor.equals(ToolTipButtonAnchor.NORTH)) {
        panel.add(extraComponent, BorderLayout.NORTH);
      }
      else if (extraComponentAnchor.equals(ToolTipButtonAnchor.EAST)) {
        panel.add(extraComponent, BorderLayout.EAST);
      }
      else if (extraComponentAnchor.equals(ToolTipButtonAnchor.WEST)) {
        panel.add(extraComponent, BorderLayout.WEST);
      }
    }

    Border out = BorderFactory.createLineBorder(borderColor, borderThickness);
    Border in =
      BorderFactory.createEmptyBorder(margin.top, margin.left, margin.bottom,
        margin.right);
    Border border = BorderFactory.createCompoundBorder(out, in);
    panel.setBorder(border);

    popup = new JPopupMenu();
    popup.setBorder(BorderFactory.createEmptyBorder());
    popup.add(panel);

    popup.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseExited(MouseEvent e) {
        tryDisposeTooltip();
      }
    });

    popup.pack();
    popup.show(ToolTipButton.this, 0, getHeight());

    Point point = popup.getLocationOnScreen();
    Dimension dim = popup.getSize();
    popupBounds =
      new Rectangle2D.Double(point.getX(), point.getY(), dim.getWidth(),
        dim.getHeight());
  }